View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default hard drive swap means vba code isn't running

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.

--
Regards,
Tom Ogilvy

"Doug Wills" <doug wills at rtobestway d0t c0m wrote in message
...
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