Problem executing Excel macro from matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Image Analyst
2015년 7월 11일
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?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!