Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 334
Default 2007 v 2003 compatability

I have written a macro ing Excel 2007, but when we try to run it using 2003
it falls over.

This is the first line of code it stops at. We are trying to sort on Row 1.

ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.AddKey:=_
Range("A1:AM1"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=_xlSortNormal

(Sorry about the way it looks here)

How does this translate to 2003? Should it be different?

Thanks
Rick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 2007 v 2003 compatability

I just recorded a sort with a header and this is what I got

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


--
HTH,
Barb Reinhardt



"Rick" wrote:

I have written a macro ing Excel 2007, but when we try to run it using 2003
it falls over.

This is the first line of code it stops at. We are trying to sort on Row 1.

ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.AddKey:=_
Range("A1:AM1"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=_xlSortNormal

(Sorry about the way it looks here)

How does this translate to 2003? Should it be different?

Thanks
Rick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 2007 v 2003 compatability

Just to add to Barb's response.

Lots of things got added in xl2007. You may find it much easier to develop in
xl2003 (or whatever the oldest version of excel you have to support), then test
to see if it still works in xl2007 (or all the newer versions).

(All that .sort.sortfields stuff was added in xl2007.)




Rick wrote:

I have written a macro ing Excel 2007, but when we try to run it using 2003
it falls over.

This is the first line of code it stops at. We are trying to sort on Row 1.

ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.AddKey:=_
Range("A1:AM1"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=_xlSortNormal

(Sorry about the way it looks here)

How does this translate to 2003? Should it be different?

Thanks
Rick


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 2007 v 2003 compatability

You can develop in 2003, but there is no guarantee that it will all work in
2007. I have a workbook that will need to be used by users in 2003 OR 2007
so I'm having some fun! NOT!
--
HTH,
Barb Reinhardt



"Dave Peterson" wrote:

Just to add to Barb's response.

Lots of things got added in xl2007. You may find it much easier to develop in
xl2003 (or whatever the oldest version of excel you have to support), then test
to see if it still works in xl2007 (or all the newer versions).

(All that .sort.sortfields stuff was added in xl2007.)




Rick wrote:

I have written a macro ing Excel 2007, but when we try to run it using 2003
it falls over.

This is the first line of code it stops at. We are trying to sort on Row 1.

ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.AddKey:=_
Range("A1:AM1"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=_xlSortNormal

(Sorry about the way it looks here)

How does this translate to 2003? Should it be different?

Thanks
Rick


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 2007 v 2003 compatability

You're right.

That's why I included that "then test to see if it still works..." phrase.

But I bet testing, er, fixing, is easier when developed in xl2003 and modified
for xl2007--rather than vice-versa.



Barb Reinhardt wrote:

You can develop in 2003, but there is no guarantee that it will all work in
2007. I have a workbook that will need to be used by users in 2003 OR 2007
so I'm having some fun! NOT!
--
HTH,
Barb Reinhardt

"Dave Peterson" wrote:

Just to add to Barb's response.

Lots of things got added in xl2007. You may find it much easier to develop in
xl2003 (or whatever the oldest version of excel you have to support), then test
to see if it still works in xl2007 (or all the newer versions).

(All that .sort.sortfields stuff was added in xl2007.)




Rick wrote:

I have written a macro ing Excel 2007, but when we try to run it using 2003
it falls over.

This is the first line of code it stops at. We are trying to sort on Row 1.

ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("SAP ZAUMAT - WORKING").Sort.SortFields.AddKey:=_
Range("A1:AM1"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=_xlSortNormal

(Sorry about the way it looks here)

How does this translate to 2003? Should it be different?

Thanks
Rick


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excell 2007 / 2003 Compatability Issue ghowell Excel Worksheet Functions 3 November 22nd 08 02:36 AM
Compatability Issues between 2007 and 2003 TLAngelo Excel Discussion (Misc queries) 6 July 17th 08 03:42 PM
2007 Compatability Pack for Office 2003 dgob123 Excel Discussion (Misc queries) 1 May 22nd 08 02:19 PM
Office 2003 and 2007 compatability install blackwater Excel Discussion (Misc queries) 0 March 26th 08 01:10 PM
Excel compatability 2003-2007 Vitordf Setting up and Configuration of Excel 3 September 26th 07 07:21 PM


All times are GMT +1. The time now is 05:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"