
January 28th, 2005, 05:09 PM
|
|
Registered User
|
|
Join Date: Nov 2004
Location: Vancouver, BC
Posts: 12
Time spent in forums: 4 h 57 m 53 sec
Reputation Power: 0
|
|
Import VB Module in Excel File
Hello!
I have an excel file that users will use to build their own custom version into a new file. Now I would like to insert a formatting macro into the users new custom build file, but I can't get excel to add it (Error 1004: Programmatic access to Visual Basic Project is not trusted). Here is simple version of my code, any ideas? I think I need to create a Module Object first, but I don't know how to do this...
Workbooks.Add
mac_file = ThisWorkbook.Path & "\inv_plan_mac.bas"
Set VBP = ActiveWorkbook.VBProject
With VBP.VBComponents
.Import mac_file
End With
|