Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro compatibility with Excel 97
Hi,
Can someone help me. I created excel macros in Excel 2000, however when the macro is opened with Excel 97 some errors occur. These are some of them: 1.The following command gives RunTime error '1004' Unable to set the ColorIndex of property of the Interior Class Sheet13.Cells(StartRow + Row, StartColumn + Column).Interior.ColorIndex = 0 Is there any equivalant code in Excel 97 for the above command? Why the macro caused error in 97, but not in 2000? Was Interior class not part of worksheet member? 2. The application terminates automatically when a part of macro is executed and the following message is displayed on the error dialog box: "<process has already exit has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created." What is the cause of this error? Where can I find the error log? I tried to put somebreak points to trace the problem, however the error did not come out during the debug mode. It only came during run time. Why Excel 2000 doesn't have the problem? Your help is appreciated. Regards, Chris |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro compatibility with Excel 97
Question 1. There is no colorindex value of 0 (zero) in xl97, xl2000 or xl 2002..
Question 2. Post your code. The error log could be referring to the "Event" log that windows maintains. That won't be any help. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Chris L" wrote in message Hi, Can someone help me. I created excel macros in Excel 2000, however when the macro is opened with Excel 97 some errors occur. These are some of them: 1.The following command gives RunTime error '1004' Unable to set the ColorIndex of property of the Interior Class Sheet13.Cells(StartRow + Row, StartColumn + Column).Interior.ColorIndex = 0 Is there any equivalant code in Excel 97 for the above command? Why the macro caused error in 97, but not in 2000? Was Interior class not part of worksheet member? 2. The application terminates automatically when a part of macro is executed and the following message is displayed on the error dialog box: "<process has already exit has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created." What is the cause of this error? Where can I find the error log? I tried to put somebreak points to trace the problem, however the error did not come out during the debug mode. It only came during run time. Why Excel 2000 doesn't have the problem? Your help is appreciated. Regards, Chris |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro compatibility with Excel 97
I've tried to replace the value to 1, or replacing the command from
ColorIndex to Color but they stills give the same error. 'Sheet13.Cells(RowMain + Row, ColumnMain + Column).Interior.Color = RGB(126, 255, 126) 'Grey These are the codes that makes the application terminates: Sub ClearItem(StartRow As Integer, StartColumn As Integer, Optional Unused As Boolean = False) Dim Row, Column For Row = 1 To 20 Step 1 For Column = 1 To 16 Step 1 Sheet14.Cells(StartRow + Row, StartColumn + Column) = 0 'clear the status in main worksheet If Unused = False Then 'Any of the following commands terminates Excel 97 in run time 'If breakpoint and Stepover are used, there's no problem Sheet13.Range("B41") = "Standard" Sheet13.Range("C41") = "" End If Next Column Next Row End Sub Regards, Chris "Jim Cone" wrote: Question 1. There is no colorindex value of 0 (zero) in xl97, xl2000 or xl 2002.. Question 2. Post your code. The error log could be referring to the "Event" log that windows maintains. That won't be any help. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Chris L" wrote in message Hi, Can someone help me. I created excel macros in Excel 2000, however when the macro is opened with Excel 97 some errors occur. These are some of them: 1.The following command gives RunTime error '1004' Unable to set the ColorIndex of property of the Interior Class Sheet13.Cells(StartRow + Row, StartColumn + Column).Interior.ColorIndex = 0 Is there any equivalant code in Excel 97 for the above command? Why the macro caused error in 97, but not in 2000? Was Interior class not part of worksheet member? 2. The application terminates automatically when a part of macro is executed and the following message is displayed on the error dialog box: "<process has already exit has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created." What is the cause of this error? Where can I find the error log? I tried to put somebreak points to trace the problem, however the error did not come out during the debug mode. It only came during run time. Why Excel 2000 doesn't have the problem? Your help is appreciated. Regards, Chris |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro compatibility with Excel 97
Some questions, ideas, suggestions... Does "Sheet13" exist? Try replacing it with the actual worksheet name... Worksheets("Real Name").Range("B41").Value "Row" has its own meaning in Excel, don't use it as a variable name. Could StartRow + Row or RowMan + Row exceed the number of rows? (same for columns) Try using the default property for the ranges instead of relying on Excel... Sheet13.Range("B41").Value = "Standard" Copy the module code out to Notepad, delete the module and replace it with a new one. Jim Cone San Francisco, USA http://www.officeletter.com/blink/specialsort.html "Chris L" wrote in message I've tried to replace the value to 1, or replacing the command from ColorIndex to Color but they stills give the same error. 'Sheet13.Cells(RowMain + Row, ColumnMain + Column).Interior.Color = RGB(126, 255, 126) 'Grey These are the codes that makes the application terminates: Sub ClearItem(StartRow As Integer, StartColumn As Integer, Optional Unused As Boolean = False) Dim Row, Column For Row = 1 To 20 Step 1 For Column = 1 To 16 Step 1 Sheet14.Cells(StartRow + Row, StartColumn + Column) = 0 'clear the status in main worksheet If Unused = False Then 'Any of the following commands terminates Excel 97 in run time 'If breakpoint and Stepover are used, there's no problem Sheet13.Range("B41") = "Standard" Sheet13.Range("C41") = "" End If Next Column Next Row End Sub Regards, Chris "Jim Cone" wrote: Question 1. There is no colorindex value of 0 (zero) in xl97, xl2000 or xl 2002.. Question 2. Post your code. The error log could be referring to the "Event" log that windows maintains. That won't be any help. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Chris L" wrote in message Hi, Can someone help me. I created excel macros in Excel 2000, however when the macro is opened with Excel 97 some errors occur. These are some of them: 1.The following command gives RunTime error '1004' Unable to set the ColorIndex of property of the Interior Class Sheet13.Cells(StartRow + Row, StartColumn + Column).Interior.ColorIndex = 0 Is there any equivalant code in Excel 97 for the above command? Why the macro caused error in 97, but not in 2000? Was Interior class not part of worksheet member? 2. The application terminates automatically when a part of macro is executed and the following message is displayed on the error dialog box: "<process has already exit has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created." What is the cause of this error? Where can I find the error log? I tried to put somebreak points to trace the problem, however the error did not come out during the debug mode. It only came during run time. Why Excel 2000 doesn't have the problem? Your help is appreciated. Regards, Chris |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro compatibility with Excel 97
Hi again,
I tried to replace "Range" with "Cells" and the application doesn't terminates anymore. It's very strange though,... the syntax are valid and it doesn't seem to be any mistakes. I still cannot solve the Interior Class problem (Color/ColorIndex), does anyone know how to change the cell color with macro in Excel 97? Regards, Chris "Jim Cone" wrote: Some questions, ideas, suggestions... Does "Sheet13" exist? Try replacing it with the actual worksheet name... Worksheets("Real Name").Range("B41").Value "Row" has its own meaning in Excel, don't use it as a variable name. Could StartRow + Row or RowMan + Row exceed the number of rows? (same for columns) Try using the default property for the ranges instead of relying on Excel... Sheet13.Range("B41").Value = "Standard" Copy the module code out to Notepad, delete the module and replace it with a new one. Jim Cone San Francisco, USA http://www.officeletter.com/blink/specialsort.html "Chris L" wrote in message I've tried to replace the value to 1, or replacing the command from ColorIndex to Color but they stills give the same error. 'Sheet13.Cells(RowMain + Row, ColumnMain + Column).Interior.Color = RGB(126, 255, 126) 'Grey These are the codes that makes the application terminates: Sub ClearItem(StartRow As Integer, StartColumn As Integer, Optional Unused As Boolean = False) Dim Row, Column For Row = 1 To 20 Step 1 For Column = 1 To 16 Step 1 Sheet14.Cells(StartRow + Row, StartColumn + Column) = 0 'clear the status in main worksheet If Unused = False Then 'Any of the following commands terminates Excel 97 in run time 'If breakpoint and Stepover are used, there's no problem Sheet13.Range("B41") = "Standard" Sheet13.Range("C41") = "" End If Next Column Next Row End Sub Regards, Chris "Jim Cone" wrote: Question 1. There is no colorindex value of 0 (zero) in xl97, xl2000 or xl 2002.. Question 2. Post your code. The error log could be referring to the "Event" log that windows maintains. That won't be any help. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Chris L" wrote in message Hi, Can someone help me. I created excel macros in Excel 2000, however when the macro is opened with Excel 97 some errors occur. These are some of them: 1.The following command gives RunTime error '1004' Unable to set the ColorIndex of property of the Interior Class Sheet13.Cells(StartRow + Row, StartColumn + Column).Interior.ColorIndex = 0 Is there any equivalant code in Excel 97 for the above command? Why the macro caused error in 97, but not in 2000? Was Interior class not part of worksheet member? 2. The application terminates automatically when a part of macro is executed and the following message is displayed on the error dialog box: "<process has already exit has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created." What is the cause of this error? Where can I find the error log? I tried to put somebreak points to trace the problem, however the error did not come out during the debug mode. It only came during run time. Why Excel 2000 doesn't have the problem? Your help is appreciated. Regards, Chris |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro compatibility with Excel 97
Is the sheet protected?
Jim Cone "Chris L" wrote in message Hi again, I tried to replace "Range" with "Cells" and the application doesn't terminates anymore. It's very strange though,... the syntax are valid and it doesn't seem to be any mistakes. I still cannot solve the Interior Class problem (Color/ColorIndex), does anyone know how to change the cell color with macro in Excel 97? Regards, Chris |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro compatibility with Excel 97
No, it's not protected.
Anyway, as replacing "Range" to "Cells" prevents it from crashing, I'm happy with it. Thank you for your assistance. Regards, Chris "Jim Cone" wrote: Is the sheet protected? Jim Cone "Chris L" wrote in message Hi again, I tried to replace "Range" with "Cells" and the application doesn't terminates anymore. It's very strange though,... the syntax are valid and it doesn't seem to be any mistakes. I still cannot solve the Interior Class problem (Color/ColorIndex), does anyone know how to change the cell color with macro in Excel 97? Regards, Chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro compatibility problems between PC and Mac (Excel 97 and Exce | Excel Programming | |||
Macro compatibility between excel XP and 97 | Excel Programming | |||
Excel 2002/2003 Macro Compatibility issue | Excel Programming | |||
VBA - Macro backward compatibility from excel 2002 to excel 2000 | Excel Programming | |||
Excel 97 Macro Compatibility with Excel 2003 | Excel Programming |