Left-function causes compile error

Jaymond Flurrie

Well-known Member
Joined
Sep 22, 2008
Messages
919
Office Version
  1. 365
Platform
  1. Windows
What do I miss when the basic left-function of VBA causes "Can't find project or library" error? I haven't personally faced this error yet, but my friend said on some computer my program causes such an error - and in that workbook I created myself, so it should have all the references I used - right? He said that VBA.Left works, so this is pretty interesting (and unheard for me) problem.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
One thing to check
Go to the VB editor ( ALT + F11)
Select tools / References and see if there any MISSING references
If there are any, have a look here on how to repair them
Code:
http://www.cpearson.com/excel/missingreferences.aspx
 
Upvote 0
One thing to check
Go to the VB editor ( ALT + F11)
Select tools / References and see if there any MISSING references
If there are any, have a look here on how to repair them
Code:
http://www.cpearson.com/excel/missingreferences.aspx
 
Upvote 0
Ok, solved this one and I feel this is important enough to share.

1) The problem was missing Solver add-in - VBA didn't know that whether "left" was in Solver or in VBA library, so it was impossible to know which one to take

2) My program didn't work in every Windows version. It seemed like Excel version mattered something too.

The solution? Make pretty darn sure that when you code for both 32-bit and 64-bit Windows that you have the Solver add-in in BOTH program files AND in program files (x32) folders!

Another option is to check Windows version by VBA, but still the idea is that your problem can more than easily be about "wrong" Program Files folder.
 
Upvote 0

Forum statistics

Threads
1,221,687
Messages
6,161,289
Members
451,695
Latest member
Doug Mize 1024

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