Thread Subject:
.xla macro in Excel from Matlab

Subject: .xla macro in Excel from Matlab

From: Carole BAROME

Date: 9 Mar, 2010 17:21:07

Message: 1 of 1

Hi,
I am trying to use an external application from Matlbab, it's a .xla macro that I can use in Excel.
Here's my code :

actx_excel = actxserver('Excel.Application');
actx_excel.Visible = 1;
Workbooks = actx_excel.Workbooks;
Workbook = Workbooks.Open(nomfichier);
current_feuille = actx_excel.Worksheets.Item(1);
current_feuille.Activate;
xlstats = actx_excel.AddIns.Add('macro.xla',1)
actx_excel.AddIns.Item(10).Installed = 1;
result= actx_excel.ExecuteExcel4Macro('!MACRO()','Aide');

This code does not work, I have in the command window :
result = ActiveX VT_ERROR:
And the help menu of my macro has not been run.

Please, could someone help me use this macro?
Moreover, for the second step, I'd like to pass data to this macro as arguments, excel range for example.
Thanks in advance.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
executeexcel4macro Carole BAROME 9 Mar, 2010 12:24:10
excel Carole BAROME 9 Mar, 2010 12:24:10
macro Carole BAROME 9 Mar, 2010 12:24:10
actxserver Carole BAROME 9 Mar, 2010 12:24:09
rssFeed for this Thread

Contact us