Left-function causes compile error

Jaymond Flurrie

Well-known Member
Joined
Sep 22, 2008
Messages
898
Office Version
  1. 2016
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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,600
Office Version
  1. 365
  2. 2019
  3. 2013
  4. 2007
Platform
  1. Windows
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

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,600
Office Version
  1. 365
  2. 2019
  3. 2013
  4. 2007
Platform
  1. Windows
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

Jaymond Flurrie

Well-known Member
Joined
Sep 22, 2008
Messages
898
Office Version
  1. 2016
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,191,165
Messages
5,985,034
Members
439,935
Latest member
Monty238

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
Top