We are writing an exception report that populates a list of exceptions into an excel file. We then want to create a new file with those exceptions and then 2 columns that each have a dropdown menu of items to choose from. We create this dropdown with VBA we stored in a txt file. We then use Invoke VBA (the excel version) to send the VBA to the excel file. This works.
But when saving and closing, and then trying to open the file again, the file needs to be restored from a backup and the VBA is lost. What do we have to do? We are saving it as a Macro Enabled file.
If you are using invoke vba the actions given in the .vbs file will be performed on excel but the vba won’t be saved in excel. The modified excel will be saved if the save changes property is enabled inside the excel application scope. Next time you want to perform the vba you will have to do invoke vba again. If you need to keep the vba script in excel, you can add the script manually as macro in an xlsm file and to use it from UiPath you can use execute macro
Yeah we can’t really do that, because the files are on a shared drive. Another department looks at the excel file, without using UiPath.
We used this same method of adding VBA in a previous project and it saved the VBA Script in the Excel file.
Yes. But we now figured a different way to do it. We are now creating a template with the lists in the correct cells, and then pulling that template and populating it with the correct data.