Re: Excel
Re: Excel
- Subject: Re: Excel
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 08 Feb 2009 10:48:35 -0800
- Thread-topic: Excel
Title: Re: Excel
On 2/8/09 8:37 AM, "Deivy Marck Petrescu" <email@hidden> wrote:
I am scripting Excel X.
I understand that it is an old version but it does what I need.
There are some quirks with it and I'd like to know if these problems are still there in the new versions.
Problem 1:
Have an open Excel document.
The following script will not do what one expects:
---
Tell app "Microsoft Excel"
set value of Cell "A1" to 1 --sets value of cell a1 to 1
set value of Cell "B1" to 2 --sets value of cell b1 to 2
set value of Cell "C1" to 3 --sets value of every cell of column 1 to 3
end tell
--
No, this problem does not exist in Excel 2008. The value of A1 is 1, value of A2 is 2 and value of A3 is 3, and that's all.
Problem 2:
This one I can not really understand
I don't understand what you're working with here. Nor do I understand where the R3 comes from in the first statement of the script. What is "RC[-1]" meant to indicate and how does it end up as "R3" in the first example and as "RC[-1]" in the second example?
For someone not too familiar with =LOOKUP function, could you please describe what values are actually in T2:U6, what value you're trying to find ("RC[-1]" literally or something else?) and what exactly you would enter in the UI and what result you get, that you're trying to do by script. Thanks.
---
set AC84 to (ASCII character (84))
set AC85 to (ASCII character (85))
set part1 to "(RC[-1]," & (AC84 & "2:" & AC85 & "6") & "," & (AC85 & "2:" & AC85 & "6)")
set part1 to (part1 as string)
--return (part1)
tell application "Microsoft Excel" to set Value of Cell "S3" to "=Lookup" & part1
--->=LOOKUP(R3,'T2':'U6','U2':'U6')
---
---
set AC84 to (ASCII character (84))
set AC85 to (ASCII character (85))
set part1 to "(RC[-1]," & (AC84 & "2:" & AC85 & "6") & "," & (AC85 & "2:" & AC85 & "6)")
set part1 to (part1 as string)
return (part1)
tell application "Microsoft Excel" to set Value of Cell "S3" to "=Lookup" & part1
-->"(RC[-1],T2:U6,U2:U6)"
---
So, if I check to see what is part1, I see from the script above that it is what I want, but when excel puts the formula in the cell it puts single quotes around the cell references!!!!
I have no clue on what is going on!
Any help or info on the new versions would be very appreciated.
Thanks.
Deivy Petrescu
email@hidden
_______________________________________________
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
--
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:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
- Follow-Ups:
- Re: Excel
- From: Deivy Marck Petrescu <email@hidden>
References: | |
| >Excel (From: Deivy Marck Petrescu <email@hidden>) |