• 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: Excel... again. Why doesn't this work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Excel... again. Why doesn't this work (From: "Justin Laden" <email@hidden>)

  • Prev by Date: Re: Path to the user's Library folder: bug or a scripter error?
  • Next by Date: Re: Accessing a file in a bundle
  • Previous by thread: Excel... again. Why doesn't this work
  • Next by thread: Accessing a file in a bundle
  • Index(es):
    • Date
    • Thread