how to run a macro directly from progress

harpreet

New Member
Hello,

I have progress code that outputs to excel. I intilally output data to a txt file then read in the data by:

chExcelApplication:Workbooks:OpenText(txtFile,2,,,,,TRUE).

I need to perform some calculations on the data i have and want to run a macro directly from the progress code rather than transferring the code in the macro to progress code.

i have been trying to run the macro from the code like this:

chExcelApplication:RUN("C:\Progress\report\test.bas"), but i keep getting the error message "macro cannot be found". The macro does exist in that directory.

Can anyone help me and point me in the right direction on how i can access a saved macro? The saved macro is a recorded macro from excel.

Thanks.

Harpreet.
 
solved

i have worked this out with the help from progress.

basically you need to specify the excel spreadsheet that your macro is in:
Application.Run "macromaster.xls!macroname"
so in a real example:

chExcelApplication:RUN("'C:\PROGRESS\report\macrotest.xls'!testmacro").

If your spreadsheet is in a directory, make sure you put single quotes(') around the directory path.

Harpreet.
 
Back
Top