MATLAB から COM Automation Server として起動されたExcelにてアドインのマクロを使用することはできますか?
Mostra commenti meno recenti
MATLAB から COM Automation Server としてExcel を起動しました。つぎにこのExcelから自分のExcel アドインのマクロを使用させようとするとエラーとなります。
コード:
Excel = actxserver('Excel.Application');
Workbooks = get(Excel,'Workbooks');
fWorkbook = invoke(Workbooks,'Add');
fWorksheet = get(fWorkbook,'Activesheet');
fRange = fWorksheet.Range('A1:B2');
fRange.Value{1,1} = 'name';
fRange.Value{2,1} = 'foo';
fRange.Value{1,2} = 'amount';
fRange.Value{2,2} = 100;
Excel.Run('myMacro');
エラー:
ERROR: % ??? Invoke Error, Dispatch Exception:
% Source: Microsoft Office Excel
% Description: The macro 'myMacro' cannot be found.
% Help File: D:\Applications\MSOffice\OFFICE11\1033\xlmain11.chm
% Help Context ID: 0
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su MATLAB の COM オブジェクト in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!