a week ago
So I am relatively new to Blueprism and I am currently developing a process whereby I am calling the Excel VBO - runmacrofromtextfile and no matter what I do to the inputs I cannot get it to work as I think I have done something wrong with the text file that contains the macro to run, and there being no examples of just HOW this should be structured, I can't get any further
I just literally dumped the Macro from within excel VBA into a straight textfile, but I am suspecting that it should be NAMED in a specific manner as the error I get is :-
Cannot run the macro 'wxyz'. The macro may not be available in this workbook
Tuesday
You need to have the macro inside the same workbook. Try to add the macro code in the same file and run.
Tuesday
Hi @paul.wright
As Tejas mentioned you need to have VBA code in the same workbook,
There are few more things to consider as below
1. All the setting related to Macros should be enabled in your excel application.
2. Excel file should be in .xlsm or .xltm format, only then you will be able to save VBA code in it (You can access the VBA project section by pressing Alt+F11 in you excel application-> And then write VBA code by inserting a Module).
Best Regards,
Sayeed Bin Abdullah
Tuesday - last edited Tuesday
Hi Tej
So that negates the question I asked and I would just use RunMacro, as I am wanting to run a macro from a text file and not a file that contains the macro as the scenario in question is that the data file changes daily BUT needs the macro to perform some additional formatting before it is then worked
Paul
Tuesday
Hi Sayeed
See my reply to Tej above as I would have just used RunMacro if that is what I was trying to achieve but as explained, the source data file changes daily hence the use of an external text file to store the macro
Paul
Tuesday
Hey Paul,
Will the columns in the base excel be constant for every run?
If yes then you can create a template file in .xltm format and add macros in it,
Before using the RunMacro action you can copy the data into template file from the base file and then run the macro, then do Saveas to the template file and save it into source format (.xls or .xlsx).
Tuesday
Another way could be to store the macro in a new plain excel file instead of text file.
Then in BP open both files in a single handle or have a logic in macro to open the actual file and it will work that way too.
I understand the macro would not be present in the input file so having a macro template would be the right way to automate it.