Error only on some machines ... VBA Sort function

W

William DeLeo

Greetings,

I prepared a spreadsheet with macros for a client and an
error surfaces on their machines but not mine. They are
running Excel 2000 and I am running Excel 2002. Since I
can't spend that much time on their computer
troubleshooting the problem, I am in a really bad
situation.

Any guidance would be greatly appreciated.

When the following code is executed on their machines
(line breaks added for posting),

Sheets("Materials Archive").Range("A:G").Sort
Key1:=Worksheets("Materials Archive").Columns("A"),
Order1:=xlAscending, Header:=xlYes,
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal

I get the following message referring to all the above
code:

"Run-time error 1004
Application defined or object-defined error."

Thanks in advance.
 
T

Tom Ogilvy

This worked in xl2000
Sub testerA()
Sheets("Materials Archive").Range("A:G").Sort _
Key1:=Worksheets("Materials Archive").Columns("A"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub

DataOption1 was added in xl2002 I believe, so it is not recognized in
xl2000.

It doesn't appear to be necessary, so you can delete it.
 
W

William DeLeo

THANK YOU, THANK YOU, THANK YOU !!!!!!!!!!!!!!



-----Original Message-----
This worked in xl2000
Sub testerA()
Sheets("Materials Archive").Range("A:G").Sort _
Key1:=Worksheets("Materials Archive").Columns("A"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub

DataOption1 was added in xl2002 I believe, so it is not recognized in
xl2000.

It doesn't appear to be necessary, so you can delete it.

--
Regards,
Tom Ogilvy




.
 
Top