In the dictionary and in the Excel Scripting Reference, the command "get address" returns a "Range reference in the language of the macro." It actually returns text:
tell application "Microsoft Excel"
get address of range "B1:D3" ->"$B$1:$D$3"
class of the item 1 of the result ->text
end tell
That may be where the bug originates if there is one.
You might want to try this:
tell application "Microsoft Excel"
get rows of range "B1:D3" ->{row "$B$1:$D$1" of range "B1:D3" of application "Microsoft Excel", row "$B$2:$D$2" of range "B1:D3" of application "Microsoft Excel", row "$B$3:$D$3" of range "B1:D3" of application "Microsoft Excel"}
class of item 1 of the result -> row
end tell
Hope this helps a bit.
H
On 7 Mar 2010, at 21:08, Christian Prinoth wrote:
Hi,
could you please try the following applescript on your Excel 2008 for Mac?
tell application "Microsoft Excel"
select range "A1:C3"
get address of rows of selection
select range "B1:D3"
get address of rows of selection
end tell
I get the following result:
tell application "Microsoft Excel"
select range "A1:C3"
get address every row of selection
--> {"$A$1:$C$1", "$A$2:$C$2", "$A$3:$C$3"}
select range "B1:D3"
get address every row of selection
--> {"$C$1:$E$1", "$C$2:$E$2", "$C$3:$E$3"}
Basically, the rows() class screws up if the range object it refers to does not start in the first column.
Thanks
Chris
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden