Re: The Excel 2004 battle continues
Re: The Excel 2004 battle continues
- Subject: Re: The Excel 2004 battle continues
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 28 Nov 2005 11:29:58 -0800
- Thread-topic: The Excel 2004 battle continues
On 11/28/05 11:06 AM, "Robert Poland" <email@hidden> wrote:
> Been trying all morning to get this to work..
>
> set xdatas to {}
>
> tell application "Microsoft Excel"
> activate
> set xdatas to value of range "R1000C1:R1000C14"
>
> display dialog "xdatas = " & xdatas
>
> end tell
>
> This is just a part of an old working script. Excel is open and the
> correct worksheet is visible. It keeps coming up with "The variable
> xdatas is not defined." I can find lots of ways to set the cell value
> but not much on how to get data out of a cell.
>
> I have been looking at the old Applescript emails, the dictionary and
> the Excel 2004 AppleScript Reference.pdf. I even tried looking at
> Google for <excel "value of range">.
>
> Any help would be appreciated.
That "R1000C1:R1000C14" is not a proper range address in Excel 2004. Excel
2004 AppleScript uses only the "A1"-style, not the "R1C1" style of range
address. I really recommend that you read the introductory section "Using
the Excel Dictionary" of the Excel 2004 AppleScript Reference - it's only a
few pages. You'll keep hitting problems like this until you do. The
description of this issue is in the "How to reference cells and ranges" on
p. 15.
In this particular case, what you want is
set xdatas to value of range "A1000:N1000" of active sheet
(N is the 14th column).
You'll find 'get address' in the Table Suite a useful command. By default
you'll get something like "$A$1000:$N$1000" for range addresses; the "$"
shows it's an absolute value, which is what you usually want (see the
Reference again).
You should get used to specifying 'of active sheet' or 'of used range of
active sheet', depending, when specifying ranges and cells - although it
will always to 'of active sheet' if you don't.
Instead of googling, read the first section of the Reference, and whatever
term you're looking for.
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden