Sign in to follow this  
Followers 0
kchk

Waiting for Excel to finish up refresh in Critix environment

3 posts in this topic

Hi... newbie to this forum and in need of help.

I am writing a simple script to refresh my excel files accessed via Critix, so it is more like a thin client/ web environment and I realise that many of Excel type command do not work, other than the usual key input or mouse click.

The story is, I need autoit to recognize that Excel has yet to complete refreshing the file before excuting the next command, such as file save or stop the timer.  So far, it does not wait for excel to finish up the loop and send in the next command too soon.

Here's the basic code:

Global $file_state00 = "Microsoft Excel - Remote"
Global $file_state01 = "Excel on Cognos & TM1 - Citrix XenApp Plugins for Hosted Apps"

#include <Excel.au3>
#include <array.au3>

Func _WinWaitActivate($title,$text,$timeout=0)
 WinWait($title,$text,$timeout)
 If Not WinActive($title,$text) Then WinActivate($title,$text)
 WinWaitActive($title,$text,$timeout)
EndFunc

WinActivate("Online Stopwatch - Microsoft Internet Explorer provided by","")
MouseClick("left",323,570,1)

$loop = 1
Do
_WinWaitActivate($file_state01,"")
Send("{CTRLDOWN}{PGUP}{CTRLUP}")
$loop +=1
until $loop > 31

local $refresh = 1
_WinWaitActivate($file_state01,"")

While $refresh < 4
_WinWaitActivate("Excel on Cognos & TM1 - Citrix XenApp Plugins for Hosted Apps","")
 Send("{CTRLDOWN}{PGDN}{CTRLUP}")
 Send("{F10}")
 if MouseGetCursor () = 0 Then $refresh +=1
 MouseClick("left",323,570,1)
WEnd

This portion always kick in before the mouse hour glass stop:

_WinWaitActivate("Online Stopwatch - Microsoft Internet Explorer provided by","")
MouseClick("left",965,570,1)
MouseClick("left",323,570,1)

Is there a event trigger that I can use?  I have tried the MouoseGetCursor, it works for the loop but not for the stop timer.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Welcome to Autoit and the forum!

I noticed that you include the Excel UDF but you don't use it in your script. Is there a reason?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

BTW: When posting code, could you please wrap your code in AutoIt tags (the blue "A" icon in the editor)?

Enhances readability.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0