Excel - Visual Basic Complie error

C

Chad

I have a program using Excel with Visual Basic
Programming. I have run this on many computers.
However, with my new fast computer that I bought to speed
up the process, I receive "Compile error: Can't find
project or library." It is the same version of Excel
(2003).

I haven't done anything to the file. I have tried saving
a new file, but it still wouldn't work.

The security level in Excel is the same. It asks to
Enable Macros every time the file is opened.

I appreciate any help.
 
P

papou

Hello Chad
Check for any missing reference in the Tools Reference in VBE

HTH
Cordially
Pascal
 
T

Tod

It kinda depends on what code is running when you get the
error. However, generally it's a reference that is broken.
Open the VB Editor and go to Tools>References. Scroll
through the checked references to see if any say Broken
next to them. If so, uncheck the box and look for another
instance of that library in the list and check it.

Or, such as with using ADO or switching to an older
version of Office, you may need to download the MDAC from
Microsoft. Here's a link to that:

http://www.microsoft.com/downloads/details.aspx?
FamilyID=6c050fe3-c795-4b7d-b037-
185d0506396c&displaylang=en

One of those may work for you.

tod
 
G

Guest

How do I check the library reference? Where is it?

I have tried reinstalling Excel with every option
chosen. Still isn't fixed.

Thanks.


-----Original Message-----
Are you sure you have all of the required references
checked in your new installation? If a library reference
is not checked(it will be at the top of the reference
list) scroll down and check it.
If this isn't the problem, try isolating the part of the
program which causes the error message. Do you get the
error in other spreadsheets or spreadsheets without
programs? If so, you might try reinstalling Excel.
 
C

chad

I compared the References on my laptop (that runs the
program) and my desktop (which is having problems). The
same four References are checked. None are broken.

I also downloaded MDAC, which did not correct the problem.

Any other suggestions?

Thank you.
 
N

Norman Jones

Hi Chad,
I compared the References on my laptop (that runs the
program) and my desktop (which is having problems). The
same four References are checked. None are broken.

Did, you however check to see if any *other* references are shown as missing
on the problem machine?


---
Regards,
Norman



news:[email protected]...
 
N

Norman Jones

If you are certain that the code is identical, all the references checked
on the 'working' machines are also checked on the 'problem' machine and
there are no 'missing' references on the problem machine, I am afraid that I
am stumped.

At the risk of incurring your ire, I would suggest that you verify that your
these three conditions truly do pertain.

If the solution lies elswhere, please accept my apologies for raising your
blood pressure and wasting your time.
 
C

Chad

You were correct. Once I was able to get into the References, I found that it stated, "MISSING: Microsoft Common Dialog Control 6.0 (SP3)." As others have suggested, I tried to uncheck it. However, it states "Can't remove control or reference; in use." How do I fix this problem?

Thank you again.
 
N

Norman Jones

Hi Chad,

You cannot remove the reference because Microsoft Common Dialog Control is
being used in your programs.

Select the missing reference and hit the browse button and look for
COMDLG32.OCX which , under Windows XP, may be in the C:\WINDOWS\system32
folder. Alternatively, perform a preliminary search for the ocx.

The Common Dialog Control does not come with Excel (although I cannot speak
for xl2003). It is normally supplied with VB6 or Visual Studio.

---
Regards,
Norman




Chad said:
You were correct. Once I was able to get into the References, I found
that it stated, "MISSING: Microsoft Common Dialog Control 6.0 (SP3)." As
others have suggested, I tried to uncheck it. However, it states "Can't
remove control or reference; in use." How do I fix this problem?
 
Top