Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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 ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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 ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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 ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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 ***



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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 ***
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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 ***

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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 ***
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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***


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 / application.filesearch no longer works Pete Ross Excel Programming 1 September 15th 08 06:25 PM
Code No Longer Works in 2007 Chaplain Doug Excel Programming 2 February 6th 07 06:12 PM
Excel 2000 - Microsoft Investor Stock Quotes.iqy no longer works? Suzanne Excel Programming 1 December 5th 05 05:13 AM
folderexists code no longer works after moving to excel 2003 sdharris - ExcelForums.com Excel Programming 1 May 2nd 05 09:57 AM
VB6 Excel 97 code no longer works if Win2K SP3/4 applied. Tim R[_3_] Excel Programming 5 October 10th 04 06:24 AM


All times are GMT +1. The time now is 03:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"