Exporting from Matlab to excel with macro.
古いコメントを表示
I have matrix which I have to add in excel file. Excel file looks like in picture. With StartLoft, than StartCurve, than matrix which needs to be added, than EndCurve, EndLoft, End.

In this excel I should have embedded macro file to just open excel after starting matlab code, and run macro, without adding it additionaly. Is this possible? Macro code for excel is attached.
4 件のコメント
Guillaume
2018 年 7 月 10 日
Is this any different from your previous question with the exact same title, which you've completely ignored?
Guillaume
2018 年 7 月 10 日
In addition, the first lines of the text file you've attached has this:
COPYRIGHT DASSAULT SYSTEMES 2001
Have you got permission from the copyright holder to post the file here?
Matija Kosak
2018 年 7 月 10 日
Matija Kosak
2018 年 7 月 10 日
採用された回答
その他の回答 (1 件)
Sayyed Ahmad
2018 年 7 月 10 日
you have to use activeX in matlab to start Excel
e = actxserver('excel.application');
e.visible=1;
%%new Woorkbook
eWorkbooks = get(e, 'Workbooks');
% neuWB=Add(eWorkbooks)
%%open a Workbook
neuWB=eWorkbooks.Open('YourExcelFile.xlsm');
Now you kann start your Macro in Excel
%%makro starten
e.ExecuteExcel4Macro(['!NameOfModule.NameOfSub(' INPUT_ValuesFromMatlabInExcel ')']);
%%save your work in excel
neuWB.Save();
neuWB.Saved = 1;
neuWB.Close;
%%excel clear and close
e.Quit;
e.delete
I hope that is what you need!
cheers Ahmad
2 件のコメント
Guillaume
2018 年 7 月 10 日
Note that this requires that the macro already exists in the workbook and that macros are enabled. In most recent versions of Excel, if you have the default security settings, unless the macro is signed, macros will be disabled.
I would not recommend lowering the security settings as macro viruses are still common.
Matija Kosak
2018 年 7 月 10 日
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!