hard drive swap means vba code isn't running

  • Thread starter Thread starter Doug Wills
  • Start date Start date
D

Doug Wills

Hello All,

I am hoping someone can help me. Over the last few years, I have developed
an extensive list of programs in VBA under Excel to automate various
business tasks. These have always worked fine. Recently I had to re-install
Win2k to a new hard drive (I corrupted my registry on the old installation).
I have reloaded Office (2000 Pro) and copied over all of my spreadsheets.

Everything looks ok, however, when I try to run one of my programs, it bombs
with a message stating "Compile error. Can't find project or library." I am
sure that I haven't reinstalled something correctly, but don't know where to
look.

Two other things that may or may not be relevant. One, I had VB6 installed
on the old harddrive but not on the new one. I just purchased vb.net and
have not yet installed it, but I can't figure out why that would cause the
problem. Shouldn't the installation of VB6 or VB.Net be irrelevant? Two,
when the code aborts, it is highlighting a line that reads "Rundate =
Mid(Data, 43, 22)" with the MID highlighted. Don't know if either of these
is an issue, but once again, I can't figure out why they would be.

Any help is greatly appreciated. I've got some Managers waiting to hear what
their monthly rankings are and this is holding up the whole process.

Thanks

Doug Wills
 
With only one workbook open, run the code until you get the error.

then go to tools=>References (in the VBE) (you may have to hit the reset
button first) and look at the list of references selected. At least one
will appear as MISSING.

any missing references are the cause of your problem. If you don't need
them, uncheck them. If you do, you need to install that library.

References are stored with the workbook. when you do Tools=>References, you
are looking at the references associated with the activeproject -- the one
highlighted in the project explorer. Make sure you are looking at the
correct project when you do it.
 
Tom Ogilvy said:
With only one workbook open, run the code until you get the error.

then go to tools=>References (in the VBE) (you may have to hit the reset
button first) and look at the list of references selected. At least one
will appear as MISSING.

any missing references are the cause of your problem. If you don't need
them, uncheck them. If you do, you need to install that library.

References are stored with the workbook. when you do Tools=>References, you
are looking at the references associated with the activeproject -- the one
highlighted in the project explorer. Make sure you are looking at the
correct project when you do it.


Tom,


Thanks for the quick response. Right on target and worked like a charm. It
seems that MSMAPI32.OCX was trying to load but wasn't in my WINNT/SYSTEM32
folder. Removing the reference fixed this particular program, and I will
spend some time checking the others now. I really appreciate the help.

As a side note, is there any benefit to copying this file over? or is simply
removing the refenrence good enough? I believe that the MSMAPI ocx was used
to test sending some email directly from Excel, but I never got very far and
I never implemented it (I may be wrong - I don't remember exactly why this
reference was added for sure.)

Either way, I seem to be back on track. Thanks a lot for your help.

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top