ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   opening excel through visual basic (https://www.excelbanter.com/excel-programming/326498-opening-excel-through-visual-basic.html)

kafoury123

opening excel through visual basic
 
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??

OJ[_2_]

opening excel through visual basic
 
Does this work?

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

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

Hth,
OJ


Bob Phillips[_6_]

opening excel through visual basic
 
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)


"OJ" wrote in message
ups.com...
Does this work?

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

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

Hth,
OJ




kafoury123

opening excel through visual basic
 
sorry , but what should replace fullname in (oAddin.FullName) and do i write
oAddin with an o?!

"Bob Phillips" wrote:

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)


"OJ" wrote in message
ups.com...
Does this work?

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

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

Hth,
OJ





Bob Phillips[_6_]

opening excel through visual basic
 
Nothing, use as given.

--

HTH

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


"kafoury123" wrote in message
...
sorry , but what should replace fullname in (oAddin.FullName) and do i

write
oAddin with an o?!

"Bob Phillips" wrote:

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)


"OJ" wrote in message
ups.com...
Does this work?

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

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

Hth,
OJ








All times are GMT +1. The time now is 06:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com