f



Set matlab = GetObject(, "Matlab.Application")

How can I address via COM interface to existing instance of MATLAB
from VBA.

This construction doesnt work:
Set matlab = GetObject(, "Matlab.Application")

It is a bug or a feature?
0
loh (4)
1/24/2006 12:28:13 PM
comp.soft-sys.matlab 211266 articles. 18 followers. lunamoonmoon (258) is leader. Post Follow

4 Replies
1102 Views

Similar Articles

[PageSpeed] 8

JackFrost wrote:
>
>
> How can I address via COM interface to existing instance of MATLAB
> from VBA.
>
> This construction doesnt work:
> Set matlab = GetObject(, "Matlab.Application")
>
> It is a bug or a feature?

Try to use FindWindow.
0
1/25/2006 6:50:48 AM
>
> Try to use FindWindow.

HWND = FindWindowA("0", "MATLAB")
it is possible to find handle of MATLAB window, but how I can acess
this object via COM interface?

So Why
Set matlab = GetObject(, "Matlab.Application")
in not working???

Same construction with Excel is working perfect:
Set matlab = GetObject(, "Excel.Application")
0
loh (4)
1/25/2006 1:44:46 PM
GetObject() can be used whith MATLAB if you run it with ----desktop
/automation options.

Best regards,
 
Aleksey Komarov
Application Engineer, Mathworks department
==================================
SoftLine Company
Russia
0
no69 (380)
1/27/2006 10:43:01 AM
On Tue, 24 Jan 2006 07:28:13 -0500, JackFrost <loh@loh.loh> wrote:

>How can I address via COM interface to existing instance of MATLAB
>from VBA.
>
>This construction doesnt work:
>Set matlab = GetObject(, "Matlab.Application")
>
>It is a bug or a feature?

It's not clear which problem you have.  

If you are trying to connect to a running instance of Matlab, that
instance has to have been started with the /Automation flag.  If you
did not start the Matlab instance that way (which creates a COM
server) you will see a second instance of Matlab start minimized. 

If you are getting a VBA error, try this:

Public MatlabObject as Object



Set MatlabObject = CreateObject("Matlab.Application")

rt

0
noone3 (3603)
1/29/2006 7:05:20 PM
Reply: