Re: Excel... again. Why doesn't this work
Re: Excel... again. Why doesn't this work
- Subject: Re: Excel... again. Why doesn't this work
- From: Stan Cleveland <email@hidden>
- Date: Thu, 10 Jan 2008 14:53:08 -0800
- Thread-topic: Excel... again. Why doesn't this work
On 1/10/08 12:39 PM, Justin Laden wrote:
> The following code errors out:
>
> repeat with i from 1 to (descriptionRange)
> set x to value of cell "B" & i
> set value of cell "A" & i to x
> end repeat
>
> It gives me this error:
>
> Can't set «class DPVu» of «class ccel» "A" & i to x. Access not allowed.
Justin,
OMM, just putting in parenthesis seems to fix the problem:
repeat with i from 1 to (descriptionRange)
set x to value of cell ("B" & i)
set value of cell ("A" & i) to x
end repeat
The parentheses eliminate the ambiguity of what cell is being addressed.
Without them, AppleScript can't figure out how to set the value of the
nonexistent cell "A" to <gibberishcode> & i to x </gibberishcode>.
HTH,
Stan C.
_______________________________________________
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