G
Guest
I work with Mark who posted the following last week:
We get the error: "Run Time Error '1004' Programmatic access to Visual Basic
Project is not trusted". 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
"We have checked the "Trust Access to Visual Basic Project" check box in the
Tools>Macro>Security>Trusted Sources tab (at the bottom), but to no avail.
Any Ideas?
A poster in this newsgroup suggested that we check the registry, but not
sure how to do this. Instruction in this area would be appreciated.
Thank you, Mark"
After making sure we checked the appropriate resource under the tools menu
in the VBA editor, the macro did in fact run on my desk top computer.
However, checking this box on my lap top computer does not resolve the
problem. I have verified that both machines have the same resources checked
off, same product ID, version, and service pack. Any thoughts on why this
would work in some cases but not others?
Tom
We get the error: "Run Time Error '1004' Programmatic access to Visual Basic
Project is not trusted". 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
"We have checked the "Trust Access to Visual Basic Project" check box in the
Tools>Macro>Security>Trusted Sources tab (at the bottom), but to no avail.
Any Ideas?
A poster in this newsgroup suggested that we check the registry, but not
sure how to do this. Instruction in this area would be appreciated.
Thank you, Mark"
After making sure we checked the appropriate resource under the tools menu
in the VBA editor, the macro did in fact run on my desk top computer.
However, checking this box on my lap top computer does not resolve the
problem. I have verified that both machines have the same resources checked
off, same product ID, version, and service pack. Any thoughts on why this
would work in some cases but not others?
Tom