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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA - Reusable Code - Workbook File Importing Problem

Status
Not open for further replies.

hafod

Technical User
Mar 14, 2005
73
GB
Hi
I am trying to re-use VBA project code that I have now successfully created to implement a common data entry/validation environment for all workbooks. I have attempted to use the following approach to importing the module and user form files ino the current workbook from the common 'master' source files on the 'D' drive.

Workbooks.Add.vbProject.vbComponents.Import ("D\BOLRS\frmUserDataEntry.frm")
- this having failed I did not try to import the module code!

I put the code is put into the 'workbook Open' event and the following error message appears when the workbook loads: Runtime Error 1004 - "Programmatic access to vbProject is not trusted. Excel 2002 used.

Am I using the correct approach to do this?

Please advise / help
Best regards - hafod
 
Have you checked the macro security levels for the workbook?

Jon

One day I will find a signature worthy of this space. That day has not yet come.
 
Hi voodoojon
Thanks for response.
My Excel Workbook security settings: (Tools-Security)
'Security Level' - LOW(est)
'Trusted Sources' - Trust Access To VB Project ---UN ticked--
'Trust all AddIns etc' --Ticked--
Will investigate tomorrow - looks like the problem. Will advise.
Regards,
Hafod
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top