ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compile error (https://www.excelbanter.com/excel-programming/287817-compile-error.html)

CH

Compile error
 
I created a master template file that utilizes vlookups to pull in data from
a data file. On the master template, I have some macros, two of which are
used to hide and unhide columns.
After running the data into the master (i.e. with the vlookups), I get 40
'custom' files which I emailed out to my coworkers who are NOT on the same
network. (I mention this because all of the macros work just fine on dozens
of computers within my office).

The error occurs when they open the file and try to click the Unhide Columns
button/macro. The error reads:"Compile error in hidden module: Module 2". I
discovered that this error is due to the fact that I protected the VB
script. So I unprotected the script in the VB editor which leads to the
following error: "Compile error: can't find project of library."
At this point, the debugger highlights the word "Password" in the line with
Password = "bobbob". Here is the entire macro:
Sub UnhideComment()
'
' UnhideComment Macro
' Macro recorded 12/11/2003 by CMH
'

'
Sheets("Office").Select
ActiveSheet.Unprotect Password:="bobbob"
Columns("e:g").Select
Range("f1").Activate
Selection.EntireColumn.Hidden = False
Range("c3").Select
Password = "bobbob"
ActiveSheet.Protect Password, DrawingObjects:=True, Contents:=True,
Scenarios:=True
End Sub

YOUR HELP IS VERY MUCH APPRECIATED ... and badly needed!!
Thanks,
Chris




John Wilson

Compile error
 
Chris,

I suspect that the PC's are running different versions of Excel????
When you get the error, go to the VBA Editor and check
Tools/References
Does one of them come up as "Missing"??

John

"CH" wrote in message
...
I created a master template file that utilizes vlookups to pull in data

from
a data file. On the master template, I have some macros, two of which are
used to hide and unhide columns.
After running the data into the master (i.e. with the vlookups), I get 40
'custom' files which I emailed out to my coworkers who are NOT on the same
network. (I mention this because all of the macros work just fine on

dozens
of computers within my office).

The error occurs when they open the file and try to click the Unhide

Columns
button/macro. The error reads:"Compile error in hidden module: Module 2".

I
discovered that this error is due to the fact that I protected the VB
script. So I unprotected the script in the VB editor which leads to the
following error: "Compile error: can't find project of library."
At this point, the debugger highlights the word "Password" in the line

with
Password = "bobbob". Here is the entire macro:
Sub UnhideComment()
'
' UnhideComment Macro
' Macro recorded 12/11/2003 by CMH
'

'
Sheets("Office").Select
ActiveSheet.Unprotect Password:="bobbob"
Columns("e:g").Select
Range("f1").Activate
Selection.EntireColumn.Hidden = False
Range("c3").Select
Password = "bobbob"
ActiveSheet.Protect Password, DrawingObjects:=True, Contents:=True,
Scenarios:=True
End Sub

YOUR HELP IS VERY MUCH APPRECIATED ... and badly needed!!
Thanks,
Chris






chris huber

Compile error
 

Yes, there are two items that show 'MISSING':
"MICROSOFT ADO Ext. 2.6 for DDL and Security"
"MICROSOFT Active X Data Objects 2.6 Library"

What does this mean?
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Bob Phillips[_6_]

Compile error
 
It means that the workbook was created with one version, and is now run ning
under another version.

First make a note of the library names, then uncheck them.

Run the macros to see if they run. If they do, it means that the libraries
are not necessary, if they don't, they are.

If the macros don't run, go back to ToolsReferences and look up those
libraries in the list (they will have a different version number) and check
them.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"chris huber" wrote in message
...

Yes, there are two items that show 'MISSING':
"MICROSOFT ADO Ext. 2.6 for DDL and Security"
"MICROSOFT Active X Data Objects 2.6 Library"

What does this mean?
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Jonathan Rynd

Compile error
 
"CH" wrote in
:

At this point, the debugger highlights the word "Password" in the line
with Password = "bobbob".


When you have a missing library, it highlights the wrong thing. Ignore
what it highlights and just look at the references for what's missing.

--
My email address has an extra @ (spell it out) and an extra invalid. Please
remove them if you are not a spammer or list broker and want to reply.


All times are GMT +1. The time now is 03:17 AM.

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