Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?

Subject: Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?

From: mg

Date: 30 Oct, 2012 08:45:09

Message: 1 of 5

Hello,

I'd like to execute *.xls made by VBA in Matlab. Is it possible?

Subject: Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?

From: Steven_Lord

Date: 30 Oct, 2012 13:46:45

Message: 2 of 5



"mg" <anrdnghl@hamail.net> wrote in message
news:k6o42k$sa4$1@newscl01ah.mathworks.com...
> Hello,
>
> I'd like to execute *.xls made by VBA in Matlab. Is it possible?

The .xls extension usually denotes a Microsoft Excel spreadsheet, not an
executable.

If by "execute" you mean "read in" then yes, you should be able to do this
with XLSREAD. If that's not what you meant, you should describe in more
detail what exactly you want to do with this XLS file.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?

From: mg

Date: 31 Oct, 2012 02:59:10

Message: 3 of 5

"Steven_Lord" <slord@mathworks.com> wrote in message <k6olo5$ts$1@newscl01ah.mathworks.com>...
>
>
> "mg" <anrdnghl@hamail.net> wrote in message
> news:k6o42k$sa4$1@newscl01ah.mathworks.com...
> > Hello,
> >
> > I'd like to execute *.xls made by VBA in Matlab. Is it possible?
>
> The .xls extension usually denotes a Microsoft Excel spreadsheet, not an
> executable.
>
> If by "execute" you mean "read in" then yes, you should be able to do this
> with XLSREAD. If that's not what you meant, you should describe in more
> detail what exactly you want to do with this XLS file.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Thank you for your reply.

Subject: Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?

From: Ryan

Date: 3 Nov, 2012 04:52:10

Message: 4 of 5

I think I saw this same question, or something very similar, earlier today. What, exactly, do you want to do? Please yield more information. Before/after. What do you have now, and what do you want to have after the code runs?



"Steven_Lord" <slord@mathworks.com> wrote in message <k6olo5$ts$1@newscl01ah.mathworks.com>...
>
>
> "mg" <anrdnghl@hamail.net> wrote in message
> news:k6o42k$sa4$1@newscl01ah.mathworks.com...
> > Hello,
> >
> > I'd like to execute *.xls made by VBA in Matlab. Is it possible?
>
> The .xls extension usually denotes a Microsoft Excel spreadsheet, not an
> executable.
>
> If by "execute" you mean "read in" then yes, you should be able to do this
> with XLSREAD. If that's not what you meant, you should describe in more
> detail what exactly you want to do with this XLS file.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Subject: Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?

From: Phil Goddard

Date: 4 Nov, 2012 16:21:08

Message: 5 of 5

As other posters have mentioned, your question really doesn't make sense.

One interpretation not covered in other answers is that you want to execute a macro defined within a spreadsheet.
If so, then you need to to look at using the MATLAB-COM API (http://www.mathworks.com/help/matlab/using-com-objects-in-matlab.html).
The example for the actxserver function shows how to connect to Excel from MATLAB.
Then to execute a macro you'd need to use the Application.Run method.

An example of doing this from VBScript is given at http://stackoverflow.com/questions/10232150/run-excel-macro-from-outside-excel-using-vbscript-from-command-line
You'd need to read/understand/modify that to work from MATLAB.

Phil.

Tags for this Thread

No tags are associated with this thread.

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.

Contact us