• 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: David Wignall <email@hidden>
  • Date: Sun, 28 Sep 2003 17:56:15 +1200

on 28/9/2003 4:25 PM, Deivy Petrescu at email@hidden wrote:

> On Saturday, Sep 27, 2003, at 21:26 US/Eastern, kai wrote:

<snip>

>> To test this situation, I set up a folder on the desktop named "Excel
>> Tests"
>> Inside this, I placed 3 Excel workbook files: "xlTest1", "xlTest2" and
>> "xlTest3".
>>
>> I also placed data in each workbook - but in different columns:
>>
>> "xlTest1": worksheet 1, row 1, column 4
>> "xlTest2": worksheet 1, row 1, column 5
>> "xlTest3": worksheet 1, row 1, column 6
>>
>> I then ran this short test script:
>>
>> -----------------------------------------------------
>>
>> set xlFold to "Hard Disk:Desktop Folder:Excel Tests:"
>> set {n1, n2, n3} to {"xlTest1", "xlTest2", "xlTest3"}
>> tell application "Microsoft Excel"
>> repeat with w in {n1, n2, n3}
>> Open (xlFold & w)
>> end repeat
>> Activate Window n1
>> set lastcolumn to Column of (LastCell of Range "A1" Direction
>> xlToRight)
>> end tell

<snip>

> The problem is the command "set ScreenUpdating to false".

<snip>

> It is however a drag to not "set ScreenUpdating to false"... It will
> be much slower.

Late to the thread, so I may have missed this but why do you need to
activate anything? Once the workbooks are open you can just refer to them by
name or index number without needing to activate or select anything.
Mutating Kai's script as an example

set xlFold to "Hard Disk:Users:UserName:Desktop:Excel Tests:"
set {n1, n2, n3} to {"xlTest1.xls", "xlTest2.xls", "xlTest3.xls"}
tell application "Microsoft Excel"
repeat with w in {n1, n2, n3}
Open (xlFold & w)
end repeat
repeat with w in {n1, n2, n3}
set l to {Column of (LastCell of Range "A1" Direction xlToRight) of
Worksheet 1 of Workbook w, Value of (LastCell of Range "A1" Direction
xlToRight) of Worksheet 1 of Workbook w} --1 line
end repeat
end tell

--
Dave
_______________________________________________
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: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: AppleWorks 6: how do you set text style?
  • Next by Date: Re: Folder Action keeps dying
  • Previous by thread: Re: Bug in (scripting) Excel.
  • Next by thread: Re: Bug in (scripting) Excel.
  • Index(es):
    • Date
    • Thread