• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Big bug in Excel Applescript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Big bug in Excel Applescript?


  • Subject: Re: Big bug in Excel Applescript?
  • From: hd <email@hidden>
  • Date: Mon, 8 Mar 2010 00:05:07 +0000

May be wrong and out of my depth, but…

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"}
end tell

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
  • Follow-Ups:
    • Re: Big bug in Excel Applescript?
      • From: Christian Prinoth <email@hidden>
References: 
 >Big bug in Excel Applescript? (From: Christian Prinoth <email@hidden>)

  • Prev by Date: Re: Slow Command in Snow Leopard
  • Next by Date: Re: Slow Command in Snow Leopard
  • Previous by thread: Big bug in Excel Applescript?
  • Next by thread: Re: Big bug in Excel Applescript?
  • Index(es):
    • Date
    • Thread