• 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: Bug in (scripting) Excel.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in (scripting) Excel.


  • Subject: Re: Bug in (scripting) Excel.
  • From: Deivy Petrescu <email@hidden>
  • Date: Sun, 28 Sep 2003 22:24:00 -0400

On Sunday, Sep 28, 2003, at 20:50 US/Eastern, kai wrote:

on Sun, 28 Sep 2003 18:31:16 -0400, Deivy Petrescu wrote:


kai, thanks for your independent opinion (I'll send you the money as
we've discussed earlier...)

Don't forget, now: used, untraceable notes in various denominations and
currencies...


Done via Applescript...

tell Application "Microsoft Excel"
set ScreenUpdating to false
Open "Hard Disk:Desktop Folder:Excel Tests:xlTest1"
Open "Hard Disk:Desktop Folder:Excel Tests:xlTest2"
Open "Hard Disk:Desktop Folder:Excel Tests:xlTest3"
Tell Window "xlTest1"
LastCell Range "A1" Direction xlToRight
get Column of Range "R1C4" of Worksheet "Sheet1" of Workbook "xlTest1"
end tell
end tell

It errors here.

Here too, Deivy. However, errors occur on *either* line within the Tell
Window block - and regardless of whether ScreenUpdating is true or false:

======================

Tell Window "xlTest1"
LastCell Range "A1" Direction xlToRight

--> Microsoft Excel got an error: Range "A1" of Window "xlTest1" doesn't
understand the LastCell message.

[Error number -1708: the AppleEvent was not handled by any handler]
Note: A similar error occurs in a 'Tell Workbook' block

----------------------

Tell Window "xlTest1"
get Column of Range "R1C4" of Worksheet "Sheet1" of Workbook "xlTest1"

--> Microsoft Excel got an error: Can't make some data into the expected
type.

[Error number -1700: bad parameter data or unable to coerce the data
supplied]
Note: A similar error occurs in a 'Tell Workbook' block

======================

However, the following all work:

======================

tell Workbook "xlTest1"
LastCell Range "A1" of Worksheet 1 Direction xlToRight

--> Range "R1C4" of Worksheet "Sheet1" of Workbook "xlTest1" of application
"Microsoft Excel"

----------------------

This does not work here!

tell Worksheet 1 of Workbook "xlTest1"
LastCell Range "A1" Direction xlToRight

--> Range "R1C4" of Worksheet "Sheet1" of Workbook "xlTest1" of application
"Microsoft Excel"

----------------------

This does and I believe it it the solution I'll use.
Actually,
tell workbook "xlTest1"
tell Worksheet 1
LastCell Range A1 Direction xlToRight
end tell
end tell

works here too. It was not working because of a "select Sheet 1" statement on a tell Workbook wrapper. So it was my error not excel's.

Select is an excel command not shared by its parts apparently.


tell Range "A1" of Worksheet 1 of Workbook "xlTest1"
LastCell Direction xlToRight

--> Range "R1C4" of Worksheet "Sheet1" of Workbook "xlTest1" of application
"Microsoft Excel"

======================

tell Workbook "xlTest1"
Column of Range "R1C4" of Worksheet 1

--> 4

----------------------

tell Worksheet 1 of Workbook "xlTest1"
Column of Range "R1C4"

--> 4

----------------------

tell Range "R1C4" of Worksheet 1 of Workbook "xlTest1"
Column of it

--> 4

----------------------

(If 'Window' is inserted in place of 'Workbook', the above 6 examples will
all error.)

HTH

---
kai


Again it did, thanks a million.


To waste time debugging an AppleScript
price: $300
The medicines to cure you of the headache
price: $100
Te continuos happiness of AppleScripting
priceless


Deivy
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Bug in (scripting) Excel. (From: kai <email@hidden>)

  • Prev by Date: Re: Bug in (scripting) Excel.
  • Next by Date: Re: get eof real?
  • Previous by thread: Re: Bug in (scripting) Excel.
  • Next by thread: Re: Recursion
  • Index(es):
    • Date
    • Thread