View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default 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