tags:

views:

234

answers:

4

for some reason in my VBA code in excel, when it gets to a line of code where i am using mid it says can't find project or library. what does this mean?

A: 

Do you have any references to any library that is missing?

I've found that any bad reference -- even when not used in the code -- can throw the entire system off, so that even built-in functions are mapped wrong.

Michael Paulukonis
+1  A: 

Go to the VBA editor (e.g. by using ALT-F11).

Click on Tools->References

If any references are marked MISSING then correct those missing references. This should fix your problem.

hawbsl
missing: structure manager activex control module, i cannot uncheck it: can't remove because in use, but the macro is stopped!
I__
not sure how it can be in use while at the same time also missing. is the code in "break mode" or "stopped"? you probably need to "stop" code execution entirely then try and uncheck
hawbsl
+1  A: 

This is due some problem with references within VBA in your workbook.

In the VBA editor, go to 'Tools-> References'. There you would find a reference with 'MISSING:' in front. Uncheck that and your problem should be fixed.

If the missing reference was something like 'Visual Basic for Application' or 'Microsoft Office Object library, you should look for a reference that has no 'MISSING:' text and select this.

Dominik Fretz
missing: structure manager activex control module, i cannot uncheck it: can't remove because in use, but the macro is stopped!
I__
+2  A: 

I would go old skool and remove the structure manager activex control.

I gave similar instructions on how to do this are here!

Have a look at: regsvr32

  1. Close Excel
  2. Click Start / Run / cmd
  3. Type regsvr32 /u [path of old dll]/[filename]

Eg: regsvr32 /u c:\windows\system32\file.dll

(You can add /q to hide all messages)

Good luck!

Christian Payne