ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2003 - Error Running Macro (https://www.excelbanter.com/excel-programming/332145-excel-2003-error-running-macro.html)

Mark

Excel 2003 - Error Running Macro
 
I have received some responses to this error recently, but am interested in
others' ideas.

A program that runs in Excel 2002 will not in Excel 2003. The Excel 2003 is
on an entirely different machine.

It gets hung-up on the "For Each" line in the following code:

Dim vbModule As Object
For Each vbModule In appWB.ActiveWorkbook.VBProject.VBComponents
If vbModule.Type = 1 Then ' "1" is a module
appWB.ActiveWorkbook.VBProject.VBComponents.Remove vbModule
End If
Next vbModule

The error reads: "Run Time Error '1004' Programmatic access to Visual Basic
Project is not trusted".

We have checked the "Trust Access to Visual Basic Project" check box in the
ToolsMacroSecurityTrusted Sources tab (at the bottom)

Any ideas?

Thank you, Mark


All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com