Hi Community,
i have used this code
Dim objWord As New Microsoft.Office.Interop.Word.Application
’ Get the file path of the Word document
Dim filePath As String = v_FilePath ’ Replace with the path to your Word document
’ Open the Word document
Dim objDoc As Microsoft.Office.Interop.Word.Document = objWord.Documents.Open(DirectCast(v_FilePath, Object))
’ Execute the macro
objWord.Run(“ShiftHeadingsAndParagraphsToNewPage”)
’ Save and close the document
objDoc.Save()
objDoc.Close()
’ Quit the Word application
objWord.Quit()
to run macro in word using invoke code activity in UiPath, it is working perfectly in my system ,but when i run this code in client server it is throwing error
“Invoke Code: Exception has been thrown by the target of an invocation.”, what is the reason for this, do i need to change any settings, please help me to rectify the issue.
Regards,
Alan