String manipulation in 2007

N

nb0512

I am running a 2003 macro in Excel 2007. It fails and says 'Can't find object
or library' and highlights the word Left in Left(somestring, somenumber).
In Help I see that Left does not exist in 2007, but it does in Access. So I
include a reference the Access library (Tools/References, etc.). This does
not help.

Any suggestions anyone ? Thanks !
 
M

mcescher

I am running a 2003 macro in Excel 2007. It fails and says 'Can't find object
or library' and highlights the word Left in Left(somestring, somenumber).
In Help I see that Left does not exist in 2007, but it does in Access. SoI
include a reference the Access library (Tools/References, etc.). This does
not help.

Any suggestions anyone ? Thanks !  

Check your references to see if any of them are missing. My guess is
that because of the different versions, you're pointing to an old
library and the filename/path have changed. Uncheck the "MISSING"
reference and find the correct one in the list.

Chris M.
 
F

fisch4bill

"Left" works just fine for me in Excel 2007. Both as a formula entry in the
sheet and in the Immediate window of the VBE. Check your other library
references. Being an Excel 2003 macro the Excel and Office Object libraries
might be 11.0 whereas 2007 is 12.0.
HTH
Bill
 
C

Chip Pearson

If you have a missing reference, functions in other, available,
libraries are often "not found". In VBA, go to the Tools menu, choose
References and see if any are marked "MISSING". If so, you can uncheck
that item if you don't need it. If you do need it, you can re-install
the software that "owns" the library, contact the vendor for an
update, or change your code so that you don't need it. If it appears
to be a Microsoft library, try starting Excel with the /regserver
switch. Close Excel, then go to the Windows Start menu, choose Run,
and enter the following:

"C:\Program Files\Microsoft Office\Office12\Excel.exe" /regserver

Note that you need the quotes and that there is a space before
/regserver. Of course, your actual path to Excel.exe may be different.
The /regserver switch causes Excel to write all of its registry keys
and values back to "factory defaults". It can cure any number of ills.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
 
N

nb0512

Thanks Chip and mcescher; I found a few MISSING references and unticked them.
It works now ! There is one other issue with annoying message boxes
regarding duplicate named ranges, but I'll write a new post re this.

BR

Niko Bel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top