Re: Bug in (scripting) Excel.
Re: Bug in (scripting) Excel.
- Subject: Re: Bug in (scripting) Excel.
- From: Deivy Petrescu <email@hidden>
- Date: Sun, 28 Sep 2003 00:25:07 -0400
On Saturday, Sep 27, 2003, at 21:26 US/Eastern, kai wrote:
So that I can clarify something if it is not clear.
Here is the outoput of the log window:
____
tell Application "Microsoft Excel"
set ScreenUpdating to false
current date ...
<snip>
Sorry about the delay. I was elsewhere...
<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
-----------------------------------------------------
Output from the log window:
... <snip>
-----------------------------------------------------
From your results, it looks like the activate command fails (even
though
Excel returns a value of true.) Which Excel window physically ends up
in
front?
HTH
---
kai
It did help.
I got the culprit!
It is either me or excel.
May be I do not fully understand the meaning of the command, or it is a
bug in excel.
And I mean that!
The problem is the command "set ScreenUpdating to false".
As I understand, it means the computer screen is not going to be
refreshed, other than that, all the other commands are fully realized.
Not true!
It replies that the window is active and one might thing that all
commands are directed to that window, well, they are not!
Because of "set ScreenUpdating to false" the call to activate window,
worksheet or workbook, never really brings it to front as we understand
front. Although excel replies it did.
When I ran the script without "set ScreenUpdating to false" checking
to see if the screen was coming to front, the called screen came to
front. The script run flawlessly.
Running it with "set ScreenUpdating to false" fails misarably.
Now my question, was I misunderstanding the command or is it a bug in
excel ?
It is however a drag to not "set ScreenUpdating to false"... It will
be much slower.
even if it is not a bug, it is a bad implementation.
Thanks to all
Regards
Deivy Petrescu
http://www.dicas.com/
_______________________________________________
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.