Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro runs in Excel 2003, bombs in XP - Compatability question
Hello
Having an aggravating problem in a workbook. I didn't write it, it comes from a third party. I download this workbook from the creator's site on my Excel XP (2000) machine, it runs fine. I make some changes and save it. It works fine. I download this workbook from the creator's site on my Excel 2003 machine, it runs fine. I make some changes and save it. It works fine. If I open the file saved with Excel XP on the 2003 machine, it runs fine. If I open the file saved with Excel 2003 on the XP machine, it gives me an error as part of a VB script called module, and I can't get it to run. In other words, using the file from the XP machine, and doing work with that file on the 2003 machine, makes the file impossible to move back to the Excel XP 2002 machine. The changes I made are minor, and not even a part of the VB code that's showing up in the debugger with the error. The error code highlighted reads: Compile error: Can't find project or library When I press OK, it jumps to this part of the code: Sub AddToListBox() 'this method is called when the workbook is first opened and when rows are added to the All 'Units worksheets. This method refreshes the Listbox on the Data worksheet with data from the 'All Units worksheet. Dim iCounter As Integer Dim sDataKey As String Sheets("All Units").Select Range("A1").Select iCounter = 3 'find out how many rows in All Units worksheet contain data Do Until (Trim(Range("$A" & iCounter).Value) & Trim(Range("$B" & iCounter).Value) & Trim(Range("$C" & iCounter).Value) & Trim(Range("$D" & iCounter).Value) & Trim(Range("$E" & iCounter).Value)) = "" The word Trim is highlighted in yellow, and it stops there. I've tested really carefully, moving the file I've saved with Excel 2003 to 2 different machines with Excel 2002, and I get the same problem, yet no problem opening the same file with Excel 2003. Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro runs in Excel 2003, bombs in XP - Compatability question
When switching the workbook between versions, take a look at the references.
Suspect a reference is getting upgraded when moving to 2003 and causing the break when moving back. The symptom is simple functions like Left, Mid, Trim etc. result in compile errors. From VB | Tools | References -- Rob van Gelder - http://www.vangelder.co.nz/excel "Harry" wrote in message .. . Hello Having an aggravating problem in a workbook. I didn't write it, it comes from a third party. I download this workbook from the creator's site on my Excel XP (2000) machine, it runs fine. I make some changes and save it. It works fine. I download this workbook from the creator's site on my Excel 2003 machine, it runs fine. I make some changes and save it. It works fine. If I open the file saved with Excel XP on the 2003 machine, it runs fine. If I open the file saved with Excel 2003 on the XP machine, it gives me an error as part of a VB script called module, and I can't get it to run. In other words, using the file from the XP machine, and doing work with that file on the 2003 machine, makes the file impossible to move back to the Excel XP 2002 machine. The changes I made are minor, and not even a part of the VB code that's showing up in the debugger with the error. The error code highlighted reads: Compile error: Can't find project or library When I press OK, it jumps to this part of the code: Sub AddToListBox() 'this method is called when the workbook is first opened and when rows are added to the All 'Units worksheets. This method refreshes the Listbox on the Data worksheet with data from the 'All Units worksheet. Dim iCounter As Integer Dim sDataKey As String Sheets("All Units").Select Range("A1").Select iCounter = 3 'find out how many rows in All Units worksheet contain data Do Until (Trim(Range("$A" & iCounter).Value) & Trim(Range("$B" & iCounter).Value) & Trim(Range("$C" & iCounter).Value) & Trim(Range("$D" & iCounter).Value) & Trim(Range("$E" & iCounter).Value)) = "" The word Trim is highlighted in yellow, and it stops there. I've tested really carefully, moving the file I've saved with Excel 2003 to 2 different machines with Excel 2002, and I get the same problem, yet no problem opening the same file with Excel 2003. Thank you |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro runs in Excel 2003, bombs in XP - Compatability question
Rob, what do you mean references? Where?
Thanks Harry On Wed, 2 Mar 2005 18:48:07 +1300, "Rob van Gelder" wrote: When switching the workbook between versions, take a look at the references. Suspect a reference is getting upgraded when moving to 2003 and causing the break when moving back. The symptom is simple functions like Left, Mid, Trim etc. result in compile errors. From VB | Tools | References -- Rob van Gelder - http://www.vangelder.co.nz/excel "Harry" wrote in message . .. Hello Having an aggravating problem in a workbook. I didn't write it, it comes from a third party. I download this workbook from the creator's site on my Excel XP (2000) machine, it runs fine. I make some changes and save it. It works fine. I download this workbook from the creator's site on my Excel 2003 machine, it runs fine. I make some changes and save it. It works fine. If I open the file saved with Excel XP on the 2003 machine, it runs fine. If I open the file saved with Excel 2003 on the XP machine, it gives me an error as part of a VB script called module, and I can't get it to run. In other words, using the file from the XP machine, and doing work with that file on the 2003 machine, makes the file impossible to move back to the Excel XP 2002 machine. The changes I made are minor, and not even a part of the VB code that's showing up in the debugger with the error. The error code highlighted reads: Compile error: Can't find project or library When I press OK, it jumps to this part of the code: Sub AddToListBox() 'this method is called when the workbook is first opened and when rows are added to the All 'Units worksheets. This method refreshes the Listbox on the Data worksheet with data from the 'All Units worksheet. Dim iCounter As Integer Dim sDataKey As String Sheets("All Units").Select Range("A1").Select iCounter = 3 'find out how many rows in All Units worksheet contain data Do Until (Trim(Range("$A" & iCounter).Value) & Trim(Range("$B" & iCounter).Value) & Trim(Range("$C" & iCounter).Value) & Trim(Range("$D" & iCounter).Value) & Trim(Range("$E" & iCounter).Value)) = "" The word Trim is highlighted in yellow, and it stops there. I've tested really carefully, moving the file I've saved with Excel 2003 to 2 different machines with Excel 2002, and I get the same problem, yet no problem opening the same file with Excel 2003. Thank you |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro runs in Excel 2003, bombs in XP - Compatability question
References are Visual Basic links to other sources of compiled code.
eg. Reference to another workbook or OCX or DLL or TPL You add References from the Visual Basic Editor - Tools menu, References -- Rob van Gelder - http://www.vangelder.co.nz/excel "Harry" wrote in message ... Rob, what do you mean references? Where? Thanks Harry On Wed, 2 Mar 2005 18:48:07 +1300, "Rob van Gelder" wrote: When switching the workbook between versions, take a look at the references. Suspect a reference is getting upgraded when moving to 2003 and causing the break when moving back. The symptom is simple functions like Left, Mid, Trim etc. result in compile errors. From VB | Tools | References -- Rob van Gelder - http://www.vangelder.co.nz/excel "Harry" wrote in message ... Hello Having an aggravating problem in a workbook. I didn't write it, it comes from a third party. I download this workbook from the creator's site on my Excel XP (2000) machine, it runs fine. I make some changes and save it. It works fine. I download this workbook from the creator's site on my Excel 2003 machine, it runs fine. I make some changes and save it. It works fine. If I open the file saved with Excel XP on the 2003 machine, it runs fine. If I open the file saved with Excel 2003 on the XP machine, it gives me an error as part of a VB script called module, and I can't get it to run. In other words, using the file from the XP machine, and doing work with that file on the 2003 machine, makes the file impossible to move back to the Excel XP 2002 machine. The changes I made are minor, and not even a part of the VB code that's showing up in the debugger with the error. The error code highlighted reads: Compile error: Can't find project or library When I press OK, it jumps to this part of the code: Sub AddToListBox() 'this method is called when the workbook is first opened and when rows are added to the All 'Units worksheets. This method refreshes the Listbox on the Data worksheet with data from the 'All Units worksheet. Dim iCounter As Integer Dim sDataKey As String Sheets("All Units").Select Range("A1").Select iCounter = 3 'find out how many rows in All Units worksheet contain data Do Until (Trim(Range("$A" & iCounter).Value) & Trim(Range("$B" & iCounter).Value) & Trim(Range("$C" & iCounter).Value) & Trim(Range("$D" & iCounter).Value) & Trim(Range("$E" & iCounter).Value)) = "" The word Trim is highlighted in yellow, and it stops there. I've tested really carefully, moving the file I've saved with Excel 2003 to 2 different machines with Excel 2002, and I get the same problem, yet no problem opening the same file with Excel 2003. Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs | Setting up and Configuration of Excel | |||
Excel 2007 macro compatability | Excel Discussion (Misc queries) | |||
Excel 2007 compatability mode, can't open when saved by excel 2003 | Excel Discussion (Misc queries) | |||
Excel compatability 2003-2007 | Setting up and Configuration of Excel | |||
Office 2000 Excel Macro runs very slow in 2003, why? | Excel Discussion (Misc queries) |