Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Use Excel Addins from VB

Status
Not open for further replies.

SeanGriffin

Programmer
Feb 23, 2001
99
US
I'm attempting to run an Excel macro from a spreadsheet that references some excel addins. When starting excel from the shortcuts or the executable this macro works fine. When I start Excel from my VB application I can't run the macro because it can't find the functions that are in the addins.


Can anyone tell me how to get the addins loaded when starting from my VB application so I can run this macro?

-Sean
 
CCLINT,

I'm not sure I understand your question. But to access Excel from VB I've added the Excel refernce and use this code:

Dim xlApp As Object
Dim xlBook As Object

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(sFileName)

I then use xlApp and xlBook to control Excel.

-Sean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top