http://www.mathworks.com/matlabcentral/newsreader/view_thread/324137
MATLAB Central Newsreader  Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?
Feed for thread: Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Tue, 30 Oct 2012 08:45:09 +0000
Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/324137#890554
mg
Hello,<br>
<br>
I'd like to execute *.xls made by VBA in Matlab. Is it possible?

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

Wed, 31 Oct 2012 02:59:10 +0000
Re: Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/324137#890616
mg
"Steven_Lord" <slord@mathworks.com> wrote in message <k6olo5$ts$1@newscl01ah.mathworks.com>...<br>
> <br>
> <br>
> "mg" <anrdnghl@hamail.net> wrote in message <br>
> news:k6o42k$sa4$1@newscl01ah.mathworks.com...<br>
> > Hello,<br>
> ><br>
> > I'd like to execute *.xls made by VBA in Matlab. Is it possible?<br>
> <br>
> The .xls extension usually denotes a Microsoft Excel spreadsheet, not an <br>
> executable.<br>
> <br>
> If by "execute" you mean "read in" then yes, you should be able to do this <br>
> with XLSREAD. If that's not what you meant, you should describe in more <br>
> detail what exactly you want to do with this XLS file.<br>
> <br>
>  <br>
> Steve Lord<br>
> slord@mathworks.com<br>
> To contact Technical Support use the Contact Us link on <br>
> <a href="http://www.mathworks.com">http://www.mathworks.com</a> <br>
<br>
Thank you for your reply.

Sat, 03 Nov 2012 04:52:10 +0000
Re: Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/324137#890834
Ryan
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?<br>
<br>
<br>
<br>
"Steven_Lord" <slord@mathworks.com> wrote in message <k6olo5$ts$1@newscl01ah.mathworks.com>...<br>
> <br>
> <br>
> "mg" <anrdnghl@hamail.net> wrote in message <br>
> news:k6o42k$sa4$1@newscl01ah.mathworks.com...<br>
> > Hello,<br>
> ><br>
> > I'd like to execute *.xls made by VBA in Matlab. Is it possible?<br>
> <br>
> The .xls extension usually denotes a Microsoft Excel spreadsheet, not an <br>
> executable.<br>
> <br>
> If by "execute" you mean "read in" then yes, you should be able to do this <br>
> with XLSREAD. If that's not what you meant, you should describe in more <br>
> detail what exactly you want to do with this XLS file.<br>
> <br>
>  <br>
> Steve Lord<br>
> slord@mathworks.com<br>
> To contact Technical Support use the Contact Us link on <br>
> <a href="http://www.mathworks.com">http://www.mathworks.com</a>

Sun, 04 Nov 2012 16:21:08 +0000
Re: Hello, I'd like to execute *.xls made by VBA in Matlab. Is it possible?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/324137#890904
Phil Goddard
As other posters have mentioned, your question really doesn't make sense.<br>
<br>
One interpretation not covered in other answers is that you want to execute a macro defined within a spreadsheet.<br>
If so, then you need to to look at using the MATLABCOM API (<a href="http://www.mathworks.com/help/matlab/usingcomobjectsinmatlab.html">http://www.mathworks.com/help/matlab/usingcomobjectsinmatlab.html</a>).<br>
The example for the actxserver function shows how to connect to Excel from MATLAB.<br>
Then to execute a macro you'd need to use the Application.Run method.<br>
<br>
An example of doing this from VBScript is given at <a href="http://stackoverflow.com/questions/10232150/runexcelmacrofromoutsideexcelusingvbscriptfromcommandline">http://stackoverflow.com/questions/10232150/runexcelmacrofromoutsideexcelusingvbscriptfromcommandline</a><br>
You'd need to read/understand/modify that to work from MATLAB.<br>
<br>
Phil.