Error Message

S

Steve

I'm trying to run a spreadsheet program written by someone else, but
successfully used by many other people.

I'm getting an error message when I hit the "Go" button. The macro runs for
some time and then stops with this error message:

Run-time error '1004'
Application-defined or object defined error

Debug takes me to the following highlighted area:

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


I'm using Excel 2000 and Windows XP Pro (with SP2)

Can anyone shed light on this problem?

Thanks for any help,


Steve
 
S

Sean

My guess Steve is one of the values within the sort is not supported
in XL2000. I had a similar problem in code written in XP which would
debug on XL2000. Can't text as I don't have XL2000. Does the debug not
highlight a specifc part of the sort code?

Try and record on your own PC the sort action and see how this code
matches to the one you quote

HTH
 
S

Steve

Dave,

How do I remove it? I get an error message if I just stick a " ' " in front
of the line.

Steve
 
D

Dave Peterson

This
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
becomes
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

(preceding comma, line continuation character, parm and value are removed)
 
S

Steve

Dave,

It works!

Many thanks,

Steve


Dave Peterson said:
This
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
becomes
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

(preceding comma, line continuation character, parm and value are removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top