Re: 2003 -> 2000 incompatability
- From: john <john@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 4 Mar 2008 10:58:00 -0800
Hi Peter,
I had tried my suggested approach awhile ago for desktops using different
versions of Excel and much to my suprise, it worked. I think it's just one of
the Excel VBA quirks - you never know until you give it a go! However and as
I also stated, if changes required were more than just resolving sort routine
problem, Dale should follow your suggestion.
--
JB
"Peter T" wrote:
Hi Dave,.
Earlier I suggested pretty much the same as you as to how to cater for
multiple versions.
But somewhat to my surprise John's example does compile in my XL2k providing
xlSortNormal is changed to its appropriate number.
Regards,
Peter T
"Dave Peterson" <petersod@xxxxxxxxxxxxxxxx> wrote in message
news:47CD7FB2.77F1211F@xxxxxxxxxxxxxxxxxxx
I don't think that this will compile in xl2k. That DataOption1 portionwill
cause a compile error.compile it.
There are workarounds, though.
if val(application.version) < 11 then
'do the sort right here
else
'call a routine in a different module that is written for xl2002+
end if
By having the routine in a different module, xl2k won't even try to
are n/a
john wrote:
if it's just sort routine causing problems then you could test for excel
version - something like:(not tested)
With Selection
If Val(Application.Version) < 11 Then
.Sort Key1:=Range("A2"), _
Order1:=xlAscending, _
Header:=xlYes, _
MatchCase:=False, _
Orientation:=xlTopToBottom
Else
.Sort Key1:=Range("A2"), _
Order1:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End If
End With
However, if more than this then follow Peter T suggestion.
--
JB
"Peter T" wrote:
Remove arguments OrderCustom:=1 and DataOption1:=xlSortNormal which
codein XL2000.
If required, you can make version specific functions by placing the
containthat won't be recognized in say XL2000 in a module that will only
out Iprocedures that will be called in later versions.
Regards,
Peter T
"Dale Fye" <dale.fye@xxxxxxxxxx> wrote in message
news:46391028-E61D-4460-B9D8-EA495E975136@xxxxxxxxxxxxxxxx
I've got an Excel application that was written in 2003. Now I find
2003have a user that is still using 2000, and at least one segment of my
sortscode is not working. I have a routine that selects a work***, and
the lastit
by a particular field. When this user runs this code, it bomb on
theline 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
method.DataOption1 or the xlSortNormal, or something else in the Sort
thisWould
greatly appreciate if someone could provide the correct code to run
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.
--
Dave Peterson
- Follow-Ups:
- Re: 2003 -> 2000 incompatability
- From: Peter T
- Re: 2003 -> 2000 incompatability
- References:
- 2003 -> 2000 incompatability
- From: Dale Fye
- Re: 2003 -> 2000 incompatability
- From: Peter T
- Re: 2003 -> 2000 incompatability
- From: john
- Re: 2003 -> 2000 incompatability
- From: Dave Peterson
- Re: 2003 -> 2000 incompatability
- From: Peter T
- 2003 -> 2000 incompatability
- Prev by Date: Re: Transfer Data from Input Form - Offset to different work***
- Next by Date: Need help with a randomization problem in Excel using PopTools
- Previous by thread: Re: 2003 -> 2000 incompatability
- Next by thread: Re: 2003 -> 2000 incompatability
- Index(es):