ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA code for excel 2000 no longer works in excel 2007 (https://www.excelbanter.com/excel-programming/418054-vba-code-excel-2000-no-longer-works-excel-2007-a.html)

Blaine[_3_]

VBA code for excel 2000 no longer works in excel 2007
 
Hello everyone,

A single line of my vba code that I use to use all the time in excel
2000 no longer works in excel 2007. When I try to use the command:

Left(myString, Len(myString) - 1) is get the following error:

"Compile Error: Can't find project or library"

I made sure to use the "Run all items from my computer" when installing
excel 2007, so all libraries should be present.

Any ideas?

Thanks in advanced



*** Sent via Developersdex http://www.developersdex.com ***

Ron de Bruin

VBA code for excel 2000 no longer works in excel 2007
 
Hi Blaine

If you look in ToolsReferences in the VBA editor
Do you see a Missing item in the list


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Blaine" wrote in message ...
Hello everyone,

A single line of my vba code that I use to use all the time in excel
2000 no longer works in excel 2007. When I try to use the command:

Left(myString, Len(myString) - 1) is get the following error:

"Compile Error: Can't find project or library"

I made sure to use the "Run all items from my computer" when installing
excel 2007, so all libraries should be present.

Any ideas?

Thanks in advanced



*** Sent via Developersdex http://www.developersdex.com ***


Blaine[_3_]

VBA code for excel 2000 no longer works in excel 2007
 
Thanks for the reply Ron. For some reason, when I click "Tools", I can
see "References" but it is grayed out so that I can't select it. Do you
know what I might be doing wrong?

Thanks



*** Sent via Developersdex http://www.developersdex.com ***

Blaine[_3_]

VBA code for excel 2000 no longer works in excel 2007
 


Ron,

Ok, I have the following check marked under Tools-References:

"Visual Basic for Applications"
"Microsoft Excel 12.0 Object Library"
"OLE Automation"
and
"Microsoft Office 12.0 Object Library"


*** Sent via Developersdex http://www.developersdex.com ***

Ron de Bruin

VBA code for excel 2000 no longer works in excel 2007
 
If you not see one with "missing" in it it is OK

Do you have the same problem if you try it in another workbook

Sub aaa()
Dim myString As String

myString = "12345"
MsgBox Left(myString, Len(myString) - 1)

End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Blaine" wrote in message ...


Ron,

Ok, I have the following check marked under Tools-References:

"Visual Basic for Applications"
"Microsoft Excel 12.0 Object Library"
"OLE Automation"
and
"Microsoft Office 12.0 Object Library"


*** Sent via Developersdex http://www.developersdex.com ***


Blaine[_3_]

VBA code for excel 2000 no longer works in excel 2007
 
Ron,

That's a good point. I tried it and it works in another workbook. I
probably should have mentioned this earlier, but the "Left(myString,
Len(myString) - 1)" is buried in an xla file (addin). Any ideas on why
it would work as a direct macro but not in the addin?



*** Sent via Developersdex http://www.developersdex.com ***

Ron de Bruin

VBA code for excel 2000 no longer works in excel 2007
 
Have checked the references of the add-in ?
Select the add-in project first on the left in the editor



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Blaine" wrote in message ...
Ron,

That's a good point. I tried it and it works in another workbook. I
probably should have mentioned this earlier, but the "Left(myString,
Len(myString) - 1)" is buried in an xla file (addin). Any ideas on why
it would work as a direct macro but not in the addin?



*** Sent via Developersdex http://www.developersdex.com ***


Blaine[_3_]

VBA code for excel 2000 no longer works in excel 2007
 
Thanks for your help Ron,

I'm not sure why, but for some reason it started working!

Talk to you later,
Blaine

*** Sent via Developersdex http://www.developersdex.com ***

[email protected]

VBA code for excel 2000 no longer works in excel 2007
 
Hi Blaine,
Two recommendations when this happen:
1 - Clean or decompile the VBA project normally is sufficient.
There're two utility that facilitate this:
http://www.appspro.com/Utilities/CodeCleaner.htm
http://orlando.mvps.org/VBADecompile...IdC=Orlmorewin

2 - Explicit VBA parent objects like this:
VBA.Strings.Left(myString, VBA.Strings.Len(myString) - 1)


On Oct 3, 1:49*pm, Blaine wrote:
Hello everyone,

A single line of my vba code that I use to use all the time inexcel
2000 no longer works inexcel2007. *When I try to use the command:

Left(myString, Len(myString) - 1) is get the following error:

"Compile Error: Can't find project or library"

I made sure to use the "Run all items from my computer" when installingexcel2007, so all libraries should be present.

Any ideas?

Thanks in advanced

*** Sent via Developersdexhttp://www.developersdex.com***




All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com