Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 Tools/Macro/Security/Trusted Sources window. Any ideas? Thank you, Mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() that's strange. In my experience that message ONLY pops when AccessVBOM is disabled (UNchecked). Also afaik you cannot change that checkbox in xl2003... it's visible but greyed out and you must change it via registry. Just to be on the safe side: check that the registry setting is entirely correct: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\ Excel\Security there should be a Type : REG_DWORD Name : AccessVBOM Value: 0x1 (Enable/Allow) (Note that in xl2002 it was located in HKEY_CURRENT_USER) Other things to check... xl2003 throws oddly placed errors when References are checked but missing/invalid. Verify in Tools References that none of the references for the project are marked as [ISMISSING] hth.. but somehow i fear it wont. -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Mark wrote : 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 Tools/Macro/Security/Trusted Sources window. Any ideas? Thank you, Mark |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks keepITcool.
We were able to check the box ""Trust Access to Visual Basic Project" in xl2003, so your comment is about it being greyed-out was surprising. But maybe you can check it all you want but if it does not change in the registry then ... it won't run. Sorry for the basic question, but How does one check the registry? (Assume you are taking me through the process step by step). I have not been able to check the references yet. It is on a different machine and I don't know the password. I will check this however. Thank you for your help. "keepITcool" wrote: that's strange. In my experience that message ONLY pops when AccessVBOM is disabled (UNchecked). Also afaik you cannot change that checkbox in xl2003... it's visible but greyed out and you must change it via registry. Just to be on the safe side: check that the registry setting is entirely correct: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\ Excel\Security there should be a Type : REG_DWORD Name : AccessVBOM Value: 0x1 (Enable/Allow) (Note that in xl2002 it was located in HKEY_CURRENT_USER) Other things to check... xl2003 throws oddly placed errors when References are checked but missing/invalid. Verify in Tools References that none of the references for the project are marked as [ISMISSING] hth.. but somehow i fear it wont. -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Mark wrote : 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 Tools/Macro/Security/Trusted Sources window. Any ideas? Thank you, Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Error when running macro in Excel | Excel Programming | |||
KERNEL32.DLL error after running EXCEL Macro | Excel Programming |