Use AddIn to Open an addtional Excel Workbook

J

John Cole, Jr.

I have an Addin that I've written that contains the normal things.
However, there are references to worksheets that must be updated from
time to time. Rather than including these worksheets in the addin, I
have chose to include them in a separate workbook that contains only
those worksheets. I would like for the addin to open the workbook
automatically. Below is the Workbook_Open Code for the addin.

Private Sub Workbook_Open()
Call CreateMenu
'Open File
Dim moduleLineList As Object
Dim filePath As String
Dim fullPath As String
Dim fileNam As String
On Error Resume Next
fileNam = APPNAME & "TechData.xls"
filePath = Application.ThisWorkbook.Path
fullPath = filePath & "\" & fileNam
Set moduleLineList = GetObject(fullPath)

End Sub


This works fine on the .xls version of the addin, but whe I convert it
to an AddIn and install it, i get errors including the class name for
GetObject, etc.

Any Suggestions?
 
B

Bob Phillips

Why not just do a workbooks.open?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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