Re: Excel Q: set formula of cell
Re: Excel Q: set formula of cell
- Subject: Re: Excel Q: set formula of cell
- From: Yosemite <email@hidden>
- Date: Mon, 22 Oct 2001 06:26:55 -0800
-- this may help
set aList to {"hcir", 99, "nella", 43}
tell application "Microsoft Excel"
repeat with i from 1 to number of items in aList
set Value of Cell ("A" & i) to item i of aList
end repeat
end tell
-- hcir
mailto:email@hidden
>
I have a script that takes text from Scriptable Text Editor, creates a list
>
of text items through delimiters, and then places them in an excel
>
worksheet. The problem seems to be this line:
>
>
set Formula of Cell whichcell to item i of newText
>
>
Excel doesn't fill any cells in. It just creates a blank cell like the
>
string was "" or something.
>
>
Whichcell - variable of cell
>
Newtext - list of text items
>
Item I - a repeat loop selects 1 item at a time
>
>
Looking at the event log the line looks something like this:
>
>
Set Formula of Cell "R1C1" to "test"
>
>
I notice that "test" isn't formatted as a string. It just looks like plain
>
text. I look at the list of text items, and none of them are formatted as
>
strings. And yet, they act like strings. I've tried coercing them to
>
string, but the formatting stays the same. I can set the list to be
>
something like {1,2,3,4,5} and the script works fine. I'm not sure why
>
excel refuses to fill the "strings" in. Do I have to do something to my
>
delimiters code to make the text items list look like normal strings? TIA.