EssDee Posted December 12, 2007 Share Posted December 12, 2007 Hi! This is my first post! This is done with an Auto-It script: Opening an excel-file and click a button to update data. This update can take 5 sek to minutes. What shall I write in the script for it to wait while the dataupdate occur? The script is supposed to do more after the dataupdate. /EssDee Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 12, 2007 Share Posted December 12, 2007 Hi!This is my first post! This is done with an Auto-It script:Opening an excel-file and click a button to update data. This update can take 5 sek to minutes. What shall I write in the script for it to wait while the dataupdate occur? The script is supposed to do more after the dataupdate./EssDeeIf you automate Excel with keyboard/mouse simulation, you are left with a blind Sleep(5000), or some such, hoping to wait long enough for it to be done on the worst-case config that might run it.If you use the COM interface then functions that might take a while (like a complex sort) simply block the script until they are done. It would be nice for Office apps to have a "Busy Flag" you could check, but it just doesn't appear to exist. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Skruge Posted December 12, 2007 Share Posted December 12, 2007 Opening an excel-file and click a button to update data.Does that button call a macro function? If so you might be able to modify it to send an alert that your script can detect.Otherwise, how do you know when it finished? Are any controls disabled, or is there specific data you can look at to verify? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
EssDee Posted December 14, 2007 Author Share Posted December 14, 2007 Hi again The only way I figured out is to check the cursor... When excel is collecting data the cursor shows a wait symbol and then it's finished it goes back to the ordinary arrow. The cursor has ID 15 then waiting and goes back to ID 0 then idle. Code: Do Until MouseGetCursor() = 0 Loop This don't feels like a very safe solution but it works... so far... Link to comment Share on other sites More sharing options...
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