View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default 2003 - 2000 incompatability

Dave was right, only need to remove the DataOption1 argument, OrderCustom
works in XL2000 (contrary to what I had suggested)

If using the application specific If test as suggested by John, and the
module is headed Option Explicit, change xlSortNormal to its intrinsic
Constant value (in the immediate window ?xlSortNormal and hit enter)

Regards,
Peter T

"Dale Fye" wrote in message
...
Thanks, Peter. I'll take a look.
--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"Peter T" wrote:

Remove arguments OrderCustom:=1 and DataOption1:=xlSortNormal which are

n/a
in XL2000.

If required, you can make version specific functions by placing the code
that won't be recognized in say XL2000 in a module that will only

contain
procedures that will be called in later versions.

Regards,
Peter T

"Dale Fye" wrote in message
...
I've got an Excel application that was written in 2003. Now I find

out I
have a user that is still using 2000, and at least one segment of my

2003
code is not working. I have a routine that selects a worksheet, and

sorts
it
by a particular field. When this user runs this code, it bomb on the

last
line of the code provided below.

Selection.Sort Key1:=Range("A2"), _
Order1:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

I don't know whether this is because Excel 9.0 is not recognizing the
DataOption1 or the xlSortNormal, or something else in the Sort method.

Would
greatly appreciate if someone could provide the correct code to run

this
in
Excel 9.0.

Thanks.
--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.