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

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
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?
 
Upvote 0
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.
 
Upvote 0
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:
Upvote 0
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:
Upvote 0

Forum statistics

Threads
1,214,534
Messages
6,120,080
Members
448,943
Latest member
sharmarick

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
Back
Top