Problem executing Excel macro from matlab
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I'm doing a project that inputs an excel file, does some modifications on it, exports to a new one.
Everything works, up until I try to access a macro in my output file, then I get this:
Error using Interface.Microsoft_Excel_14.0_Object_Library._Application/Run Invoke Error, Dispatch Exception: Source: Microsoft Excel Description: Cannot run the macro 'Macro1'. The macro may not be available in this workbook or all macros may be disabled. Help File: xlmain11.chm Help Context ID: 0
Error in TEST (line 49) invoke(app,'Run','Macro1');
When I try to give it a fully qualified name, it changes the error to complaining
Error using Interface.Microsoft_Excel_14.0_Object_Library._Application/Run Invoke Error, Dispatch Exception: Source: Microsoft Excel Description: 'C:\Users\nitza\Documents\PERSONAL.XLSB' could not be found. Check the spelling of the file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved, or deleted. Help File: xlmain11.chm Help Context ID: 0
Error in TEST (line 49) invoke(app,'Run','PERSONAL.XLSB!Macro1');
Now, the macro is defined in something called "Personal.xlsb", my file is "output.xlsb". The attachment shows how excel has arranged it.
How do I access the macro? Thanks.
3 Kommentare
Image Analyst
am 11 Jul. 2015
What is an xlsb file? I only use xlsx files. If you attach your workbook, people can try the code.
When you open it in Excel, it doesn't have a yellow banner at the top with a button that say "Enable editing" does it?
Antworten (0)
Siehe auch
Kategorien
Mehr zu Use COM Objects in MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!