Excel 97 not working with 2003 excel macros

caddidle

New Member
Joined
Jul 1, 2008
Messages
5
have to use 97 for this one ancient program we use called GPP and it wont allow macros written on 2003 to work on it. is there a trick to fixing this?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

schielrn

Well-known Member
Joined
Apr 4, 2007
Messages
6,941
What do you mean by it won't allow them to work? Are you getting an error? if so can you provide the error and possibly the code?
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
xl2003 uses VBA6 whereas xl97 uses VBA5 hence there are a fair few differences. As Schielrn said, please post the code so that we can look at it.
 

caddidle

New Member
Joined
Jul 1, 2008
Messages
5
Code:
Sub Macro3() ' ' Macro3 Macro ' Macro recorded 6/26/2008 by Claude Colp ' ' Keyboard Shortcut: Ctrl+t ' 
Cells.Select 
Selection.Sort Key1:=Range("C1"), Order1:=xlAscending, Key2:=Range("B1") _ 
, Order2:=xlAscending, Key3:=Range("A1"), Order3:=xlAscending, Header:= _ 
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ 
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _ 
xlSortNormal Selection.Columns.AutoFit Selection.Replace What:="RES,", Replacement:="DA,", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False Selection.Sort Key1:=Range("C1"), Order1:=xlAscending, Key2:=Range("B1") _ 
, Order2:=xlAscending, Key3:=Range("A1"), Order3:=xlAscending, Header:= _ 
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ 
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _ 
xlSortNormal Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False Columns("C:C").Select Range("C206").Activate Selection.Replace What:=" CAP,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False Selection.Replace What:="CAP,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False Selection.Replace What:="DA,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False Selection.Replace What:="SMT,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False Selection.Replace What:=",X7R", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False Selection.Replace What:="10%,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False Selection.Replace What:="CAP", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
ActiveWindow.ScrollRow = 101 
Selection.Replace What:="OHM", Replacement:="^", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
Selection.Replace What:="1/10W,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
Selection.Replace What:="1/16W,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
Selection.Replace What:="1/8W,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
Selection.Replace What:="I.C.,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
Selection.Replace What:="INDUCTOR", Replacement:="IND", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
Selection.Replace What:=",SMT", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
Selection.Replace What:="DIODE,", Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
 
End Sub
I have this in a personal excel file so I can use it in any workbook I'm in. When I take the same code and set it up in my other machine used for programming it doesnt allow me to run them. I'll post the error when I get a second. I'm thinking that there maybe commands that arent quite the same or something even more silly.
 
Last edited by a moderator:

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,343
Office Version
  1. 365
Platform
  1. Windows
Remove every reference to DataOption1/2/3 and Replace/SearchFormat.

They were introduced in Excel 2003 as far as I'm aware.
Code:
Cells.Select
Selection.Sort Key1:=Range("C1"), Order1:=xlAscending, Key2:=Range("B1"), Order2:=xlAscending, Key3:=Range("A1"), Order3:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("C:C").Select
Range("C206").Activate
Selection.Replace What:=" CAP,", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="CAP", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="OHM", Replacement:="^", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="1/10W,", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="1/16W,", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="INDUCTOR", Replacement:="IND", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:=",SMT", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="DIODE,", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
 
Last edited:
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,707
Messages
5,833,241
Members
430,199
Latest member
Petty queen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top