Create a reference

  • Thread starter Thread starter Wes
  • Start date Start date
W

Wes

Hello,

I recently switched from Excel 2000 to Excel 2003. This
code worked fine in my old version to create a reference
to an add-in file. Can you please tell me what has to be
changed to work in 2003?

Private Sub Workbook_Open()

On Error Resume Next
With ThisWorkbook.VBProject
.References.AddFromFile ("J:\Macros.xla")
End With

Call Restore_Submenu

End Sub


Thanks,
Wes
 
There is a new security setting in Excel 2002 and 2003 that may have caused
the problem. Check Tools, Macro, Security, Trusted Publishers, Trust Access
to Visual Basic Project. This option must be selected.

--
Jim Rech
Excel MVP
| Hello,
|
| I recently switched from Excel 2000 to Excel 2003. This
| code worked fine in my old version to create a reference
| to an add-in file. Can you please tell me what has to be
| changed to work in 2003?
|
| Private Sub Workbook_Open()
|
| On Error Resume Next
| With ThisWorkbook.VBProject
| .References.AddFromFile ("J:\Macros.xla")
| End With
|
| Call Restore_Submenu
|
| End Sub
|
|
| Thanks,
| Wes
 

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

Back
Top