ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Still Won't Run in Excel 2003 (https://www.excelbanter.com/excel-programming/332953-macro-still-wont-run-excel-2003-a.html)

tom

Macro Still Won't Run in Excel 2003
 
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
ToolsMacroSecurityTrusted 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

Tom Ogilvy

Macro Still Won't Run in Excel 2003
 
Maybe you have 3rd party software like Norton which won't let it run since
it has code that modifies code.

--
Regards,
Tom Ogilvy

"Tom" wrote in message
...
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
ToolsMacroSecurityTrusted 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




CBrausa[_3_]

Macro Still Won't Run in Excel 2003
 

Tom-
You gave me a suggestion on my Nesting problem yesterday. This is the
formula I used. Unfortunately I don't know how to do the formula you
suggested.

=IF(($C1730),VLOOKUP($H17,DEPT3138,3,FALSE),IF($C 1725,VLOOKUP($H17,DEPT2630,3,FALSE),IF($C1720,VL OOKUP($H17,DEPT2125,3,FALSE),IF($C1715,VLOOKUP($H 17,DEPT1620,3,FALSE),IF($C1710,VLOOKUP($H17,DEPT1 115,3,FALSE),IF($C175,VLOOKUP($H17,DEPT610,3,FALS E),VLOOKUP($H17,DEPT15,3,FALSE)))))))

I appreciated your help I'll get out my Excel Formula book and see if I
can make it work. Thanks again. CBrausa


--
CBrausa
------------------------------------------------------------------------
CBrausa's Profile: http://www.excelforum.com/member.php...o&userid=24677
View this thread: http://www.excelforum.com/showthread...hreadid=382579


Tom Ogilvy

Macro Still Won't Run in Excel 2003
 
Well, you know what you mission and what you data is an I don't. If you can
build 7 tables, then why can't you build 1 with all 38 departments.

Anyway, good luck.

Anyway, for you current endeavor, You could use something like


=Vlookup($H17,Choose(Trunc(C17)/5+1,Dept15,Dept610,Dept1115,Dept1620,Dept212
5,Dept2630,Dept3138),3,False)

I haven't checked the math, so it might require some slight tinkering.

--
Regards,
Tom Ogilvy

"CBrausa" wrote in
message ...

Tom-
You gave me a suggestion on my Nesting problem yesterday. This is the
formula I used. Unfortunately I don't know how to do the formula you
suggested.


=IF(($C1730),VLOOKUP($H17,DEPT3138,3,FALSE),IF($C 1725,VLOOKUP($H17,DEPT263
0,3,FALSE),IF($C1720,VLOOKUP($H17,DEPT2125,3,FALS E),IF($C1715,VLOOKUP($H17
,DEPT1620,3,FALSE),IF($C1710,VLOOKUP($H17,DEPT111 5,3,FALSE),IF($C175,VLOOK
UP($H17,DEPT610,3,FALSE),VLOOKUP($H17,DEPT15,3,FAL SE)))))))

I appreciated your help I'll get out my Excel Formula book and see if I
can make it work. Thanks again. CBrausa


--
CBrausa
------------------------------------------------------------------------
CBrausa's Profile:

http://www.excelforum.com/member.php...o&userid=24677
View this thread: http://www.excelforum.com/showthread...hreadid=382579




CBrausa[_4_]

Macro Still Won't Run in Excel 2003
 

Tom-
I have approx. 130,000 rows of information and there are only, as you
know, 65,536 rows per sheet. Out of 13 columns of information per
Dept. I need to pull info from 7 of the columns over to the main
worksheet. It needs to look first at the Dept. number (C17) then at
the SKU that then leads to the information in that row and picks up the
information needed. It's works, except for the fact that it's too much
information and I get the error message, up to the point of adding the
seperate worksheets with the 5 +/- depts. on it. It also worked better
until I linked the seperate worksheets to the original Dept. info sheet,
which is updated monthly. If I knew what formula to use so it would
look at all 38 sheets that would be great.


--
CBrausa
------------------------------------------------------------------------
CBrausa's Profile: http://www.excelforum.com/member.php...o&userid=24677
View this thread: http://www.excelforum.com/showthread...hreadid=382579



All times are GMT +1. The time now is 02:04 PM.

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