opening excel through visual basic

G

Guest

please help me out
i prepared a workbook to be a template for vbasic code output, the code
fills tables and the excel do the charting and so on.
problem is: i am using the Createobject function to open the .xls file from
its location , i have MATLAB addin excelink loaded but when vbasic opens
excel this addin does not load automatically.....i heard that getobject can
help solve my problem??
 
O

OJ

Does this work?

(assuming Set xlApp = CreateObject("Excel10.Application"))

xlApp.AddIns("MATLab").Installed = True

Hth,
OJ
 
B

Bob Phillips

I don't think that this will work,. Via automation, the addins are not
loaded, it is not just that their installed property is not set. You need to
explicitly load them

Dim oAddin

For Each oAddin In Application.AddIns
If oAddin.Name = "MATLAB.xla" Then
xl.Workbooks.Open(oAddin.FullName).RunAutoMacros 1
End If
Next


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

Guest

sorry , but what should replace fullname in (oAddin.FullName) and do i write
oAddin with an o?!
 
B

Bob Phillips

Nothing, use as given.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top