Error in VB code between computers

Brian.Crawford

Board Regular
Joined
Oct 3, 2007
Messages
136
Excel 2007, I have a workbook that I am developing for some customers that uses VBA to do forms and other processing. It WORKS FINE on my 2 development machines (one Win7 other XP) but when I move to the users (and a 3rd machine of my own) I get the error:
"Compile error"
"Can't find project or library"

The first time the code stops it highlights on a Public Sub GetInfo() statement that is called by the Workbook_Open routine and marks (in blue) the word "LEFT" in the following line (in the called Sub):
DivisionID = Left(WorkBookName, Sep1 - 1)

I "reset" the code and go to one of the worksheets. The worksheet captures right clicks via:
Private Sub Worksheet_BeforeRightClick(ByVal target As Range, Cancel As Boolean)
Cancel = True
Call DivCCSummary(Application.ActiveSheet.Name, target)
End Sub

Inside DivCCSummary there is a call to a Function and it stops again on the "Public Function ..." statement and highlights the word "FORMAT" giving the same error on the following line
ctl.Value = Format(Worksheets(Sht).Range(rngName)(1, i), DlrFmt)
(I'm looping through controls here and setting some values)
This repeats on other VBA calls from the sheet, on other words like "Str(....)", etc. as well as on Calls via "Right Click"

As the items it hightlights are regular Excel/VBA items I don't understand what could be missing, especially given the sheet seems OK other than during the Sub/Function calls.

My development machines do have various add-ins (PUP7, RBS_Utilities ,Solver ,Lookup, Sumif,..).. These add-ins do not exist on the other machines. In My project there is a folder called "references" that has an entry "References to RBS_Utilities.xla" but I have no idea what in my code would make a reference to it, if in fact one exists. In fact I do not recall actually installing this set of utilities. None of these add-ins exist on the other machines but the "Reference" to RBS does still exist within the project its self.
If you think this is part of the problem how do I delete such references (via the Add-Ins menue ???) as I'm sure I don't (knownly) use and of the functions ( LEFT, STR, FORMAT can't possibly be part of it). This Add-in does not show in the Add-in list under "Excel Options", nor in the add-in manager.

Advice needed
Thanks all


Any
 
Last edited:

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
It was the RBC.. utilities and I did have a reference to it in my code. I eliminated it as per the instructions (link to "Pearson") you provided and that solved it.

Thanks very much
Brian
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,700
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top