LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you run macros that is on the Personal.xls with Labview

I have Labview 7.0 and Excel 2002. I have Labview openning up an Excel file. I also have a Macro stored in my personal workbook that runs on that file whenever it is openned, but when labview opens the file it does not run the macro. I have made it also so that it opens personal.xls before openning the file, but this changes nothing. Does anyone know a way to make the global macro that I have saved to my personal workbook run when I open an excel file from Labview?
0 Kudos
Message 1 of 2
(2,837 Views)
Stored macros are not automatically executed during ActiveX automation. To do so would almost always cause problems. You can however use ActiveX to run any macro in any open workbook.

To run the Auto_Open macro in your Personal.xls use this method:
Excel._Workbook.RunAutoMacros(xlAutoOpen)

or:
Excel._Application.Run("Personal.xls!Auto_Open")

Make sure that the other workbook is the active workbook before you run the macro.

Michael Munroe
Certified LabVIEW Developer
www.abcdef.biz
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 2 of 2
(2,837 Views)