Hi,
I am trying to sort multiple rows
tell application "Microsoft Excel"
activate
set ur to (get used range of active sheet)
repeat with i from 1 to count row in ur
sort range "A:G" of row i in ur of worksheet "Sheet1" key1 (range "A:A" of worksheet "Sheet1") order1 sort ascending orientation sort rows
end repeat
end tell
this sorts the first row then error,my event log reads
tell application "Microsoft Excel"
activate
get used range of active sheet
used range of active sheet
count every row of used range of active sheet
84
sort range "A:G" of row 1 of ur of worksheet "Sheet1" key1 range "A:A" of worksheet "Sheet1" order1 sort ascending orientation sort rows
sort range "A:G" of row 2 of ur of worksheet "Sheet1" key1 range "A:A" of worksheet "Sheet1" order1 sort ascending orientation sort rows
"Microsoft Excel got an error: The object you are trying to access does not exist"
sense it worked for the first row,I really don’t understand why it does’t work for the next row?