Path: news.mathworks.com!not-for-mail
From: "Ben Hinchliffe" <ben.hinchliffe@bluereference.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: MATLAB as ActiveX object
Date: Wed, 3 Dec 2008 00:12:01 +0000 (UTC)
Organization: Blue Reference, Inc.
Lines: 23
Message-ID: <gh4ish$hjf$1@fred.mathworks.com>
References: <gh37kp$5l3$1@fred.mathworks.com>
Reply-To: "Ben Hinchliffe" <ben.hinchliffe@bluereference.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228263121 18031 172.30.248.37 (3 Dec 2008 00:12:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 3 Dec 2008 00:12:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1498343
Xref: news.mathworks.com comp.soft-sys.matlab:504543


Hi Aleksey,
I saw this same problem while developing a product called Inference for MATLAB (enables users to execute MATLAB files/code in Word & Excel).  We didn't push hard for a workaround, but if you need a simple way to access the MATLAB API you can use Inference and access it through Word or Excel.  www.InferenceForMATLAB.com
Good luck!
-Ben

"Aleksey Komarov" <abkomarov@gmail.com> wrote in message <gh37kp$5l3$1@fred.mathworks.com>...
> Please, help me to run some code in current MATLAB session, the following example on Visual Basic Script doesn't work:
> Dim MatLab
> Dim Result
> Set MatLab = Getobject(,"Matlab.Application")
> Result = MatLab.Execute("surf(peaks)")
> Result = MatLab.Execute("a = [1 2 3 4; 5 6 7 8]")
> Result = MatLab.Execute("b = a + a ")
> msgbox Result
> 
> BUT the same code, which started new matlab kernel works fine:
> ....
> Set MatLab = CreateObject("Matlab.Application")
> Result = MatLab.Execute("surf(peaks)")
> ........
> 
> Please help!!!