필터 지우기
필터 지우기

How can I enable excel macros from matlab?

조회 수: 3 (최근 30일)
Iain
Iain 2014년 2월 11일
댓글: Iain 2014년 2월 13일
I have a problem where I need to supply a user with a template excel spreadsheet, and allow them to edit it in specific ways. I have the template spreadsheet, and I have built macros into it, to ensure that the spreadsheet behaves in a certain way. I want to cause matlab to copy the template file to a user specified location, add some info, then open the file in excel, for the user to see, and enable macros for that spreadsheet alone.
How can I use matlab to enable macros in a specified spreadsheet?

채택된 답변

Image Analyst
Image Analyst 2014년 2월 11일
You need to use ActiveX to do that. Do you know ActiveX or are willing to learn?
  댓글 수: 3
Friedrich
Friedrich 2014년 2월 12일
AFAIK there is no way of programatically enable Macros. Its a security feature and if one could workaround it programatically it wouldnt make much sense. See also here
Iain
Iain 2014년 2월 13일
I have found a solution to my problem.
It is not possible to simply use ActiveX to access Excel and tell it to change the macro security settings.
It IS possible to use ActiveX to create a new excel workbook, and manipulate it in order to create the spreadsheet you want, and to then add macros to that spreadsheet, and because it is a freshly generated spreadsheet, macros are enabled by default.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by