kchk Posted December 13, 2013 Posted December 13, 2013 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.
water Posted December 13, 2013 Posted December 13, 2013 (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 December 13, 2013 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted December 13, 2013 Posted December 13, 2013 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now