• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Compile Error : Can't find project or library

ThrottleWorks

Excel Ninja
Hi,

I am facing problem while running a macro. This macro is written by someone else.
I am getting pop-up as ‘Compile Error : Can't find project or library’.

Dim osStatussheetOBJ As Object
Set osStatussheetOB = Nothing
Set osStatussheetOB = ThisWorkbook.Worksheets("Status Sheet")

I am facing issue at above mentioned code. Can anyone please help me in this.
 
If the sequence is as you've posted
Code:
Dim osStatussheetOBJ As Object
Set osStatussheetOB = Nothing
Set osStatussheetOB = ThisWorkbook.Worksheets("Status Sheet")
Then this line has no meaning and it should be deleted.
Code:
Set osStatussheetOB = Nothing
As you are setting the reference on next line anyway to specific object.
 
Hi @Deepak sir, thanks for the help. I have rectified it now.

Hi @shrivallabha , thanks for the help.

Hi @NARAYANK991 sir, thanks for the help.

Actually I forgot to mention earlier. This macro was working fine on my machine till few days ago.

It is showing error from today. Is it anything to do with missing DLL files.
At present, on my machine, Tools --> Reference --> I can see few items with prefix as missing. Such as MISSIN: AcroIEHelper 1.0 Typ Library.

Please note, Microsoft Excel 14.0 Object Library and Microsoft Outlook 14.0 Object Library is reflecting correctly.

After doing changes suggested by @Deepak sir, I am getting bug at below line.

CheckAddSht.Range("A1").Value = Mid(oins.CurrentItem.Body, SLine, ELine - SLine)

Macro is highlighting 'Mid' word while throwing pop-up.
Can anyone please help me in this.
 
This is the cause of the same.

It is showing error from today. Is it anything to do with missing DLL files.
At present, on my machine, Tools --> Reference --> I can see few items with prefix as missing. Such as MISSIN: AcroIEHelper 1.0 Typ Library.

Uncheck them.

What is oins , Is it available there! Check in debug mode...
 
I had saved original copy in a different folder (for back-up purpose).
Just tried checking it. As soon as open excel file, I get below pop-up (code is locked).

Compile error in hidden module. ThisWorkbook.This error commonly occurs when the code is incompatible with the version, platform, or architecture of this application. Click "Help" for information on how to correct this error.

Also, in this file, macro is getting stuck at below line.

'Public t As TextStream'
 
Hi !

Again a reference issue !
The reason why sometimes it could be better to code in late binding way
when project moves to different computers …
 
I had saved original copy in a different folder (for back-up purpose).
Just tried checking it. As soon as open excel file, I get below pop-up (code is locked).

Compile error in hidden module. ThisWorkbook.This error commonly occurs when the code is incompatible with the version, platform, or architecture of this application. Click "Help" for information on how to correct this error.

Also, in this file, macro is getting stuck at below line.

'Public t As TextStream'
You will have to find all objects referenced by the library you unchecked and late bind them to generic 'object'.
 
Hi ,

Such errors as you have mentioned , where a VBA function such as MID is highlighted , may not have anything to do with missing references.

A missing reference is relevant only if the code that is being executed depends on the missing reference.

If the code that is generating the error is in no way dependent on the missing reference , then the error is most probably due to some Microsoft update.

Narayan
 
Hi ,

Such errors as you have mentioned , where a VBA function such as MID is highlighted , may not have anything to do with missing references.

A missing reference is relevant only if the code that is being executed depends on the missing reference.

If the code that is generating the error is in no way dependent on the missing reference , then the error is most probably due to some Microsoft update.

Narayan
Nah,

Quite sure Sachin has highlighted wrong cause for the error.

CheckAddSht.Range("A1").Value = Mid(oins.CurrentItem.Body, SLine, ELine - SLine)

He should be checking oins object rather which Deepak has highlighted already.
 
I had saved original copy in a different folder (for back-up purpose).
Just tried checking it. As soon as open excel file, I get below pop-up (code is locked).

Compile error in hidden module. ThisWorkbook.This error commonly occurs when the code is incompatible with the version, platform, or architecture of this application. Click "Help" for information on how to correct this error.

Also, in this file, macro is getting stuck at below line.

'Public t As TextStream'
 
A missing reference is relevant only if the code that is being executed depends on the missing reference.

That is not actually correct. Any function call to a library other than Excel that is not fully and properly qualified (e.g. Mid rather than VBA.Mid) will lead to the compiler checking its referenced libraries to locate the function. Any missing references will therefore cause a problem, regardless of whether the code is part of that library or not.
 
That is not actually correct. Any function call to a library other than Excel that is not fully and properly qualified (e.g. Mid rather than VBA.Mid) will lead to the compiler checking its referenced libraries to locate the function. Any missing references will therefore cause a problem, regardless of whether the code is part of that library or not.
Hi ,

Thanks for the correction.

I will try this out and post later.

Narayan
 
Back
Top