Hi Team,
I have created a macro in word document and ran that macro using Uipath. Now I want to run the same script in another system. How can i get that macro in the new system.
Please help me in resolving this.
Regards,
Revathi.
Hi Team,
I have created a macro in word document and ran that macro using Uipath. Now I want to run the same script in another system. How can i get that macro in the new system.
Please help me in resolving this.
Regards,
Revathi.
Hey @revathineelima,
Just have that macro file inside UiPath project.
So whenever you publish the project and run in different machines. It can able to run the same macro again.
Hope this helps.
Thanks
Hey @revathineelima,
You need to create a separate .vbs
file with macro code instead of creating inside word application.
Keep that file inside the project folder & execute the same macro in the required file.
Thanks
No problem @revathineelima,
Currently you would have created macro inside the word file…
Now I suggest you to create a separate vbscript file with macro code which you used in the word above.
This will split the resource into two - Word file & vbs file with macro code
Save vbs file inside the UiPath project folder. Whenever you execute the macro you can call that vbs file irrespective of word file or machine.
Hope this helps
Thanks
Thanks. I have a doubt. While invoking the script using invoke vbscript, what should i give in output.
Thanks
Yep @revathineelima,
Output field is not mandatory.
It’s based on the vbs script providing output or not.
If your script generates any output you can capture by passing a variable to the output field.
Hope this helps
Thanks
Thanks for the solution. Just one thing. Below bold.docx is the word document and i have a screenshot in it. I need to add border for the screenshot. So i have added script to add border.
Could you please confirm how can i link word document with VBScript.
Thanks,
Revathi
Yes this should work !
@Nithinkrishna
But changes are not getting reflected. I think i am missing the link. Below is the code which i have used in VBScript
Sub Border()
Dim i As Long, j As Long
With ActiveDocument.Range
For i = 1 To .InlineShapes.Count
With .InlineShapes(i)
.Borders(1).LineStyle = wdLineStyleSingle
.Borders(1).Color = wdColorAutomatic
End With
Next i
End With
End Sub
Regards,
Revathi
@revathineelima, This may be something related to the script.
You can first try a simple script may be just to confirm once.
Wrt the above script, You may try this document replacing active document.
Thanks
@Nithinkrishna
Thanks you so much for reply.
Instead of “With ActiveDocument.Range” what can be used to include word document.
C:\Users\tatapudi_revathi\Desktop\SampleDoc.docx is the path of the document
Regards,
Revathi.
ThisDocument
may be.
First you may try like printing out the name of the active workbook in msgbox.
Hope this helps,
Cheers