I'm new to this, but I have received so much great information here, I had to join. Here is a problem am encountering with the following code in MS Access:
objSht.Activate
objSht.Range("A 25:H44").Select
objSht.Range("A 25:H44").Sort Key1:=Range("A2 5"), Order1:=xlAscen ding, Header:=xlGuess , _
OrderCustom:=1, MatchCase:=Fals e, Orientation:=xl TopToBottom, _
DataOption1:=xl SortTextAsNumbe rs
Everything works fine up to this point and the strange thing is the above code also works the first time I run it, but for subsequent runs I get
"Run-time Error '1004'"
"Method 'Range' of object '_Global' failed"
Do I need to reset something at the end of my code?
Thanks for the help.
objSht.Activate
objSht.Range("A 25:H44").Select
objSht.Range("A 25:H44").Sort Key1:=Range("A2 5"), Order1:=xlAscen ding, Header:=xlGuess , _
OrderCustom:=1, MatchCase:=Fals e, Orientation:=xl TopToBottom, _
DataOption1:=xl SortTextAsNumbe rs
Everything works fine up to this point and the strange thing is the above code also works the first time I run it, but for subsequent runs I get
"Run-time Error '1004'"
"Method 'Range' of object '_Global' failed"
Do I need to reset something at the end of my code?
Thanks for the help.
Comment