THEgame32 Posted July 7, 2016 Share Posted July 7, 2016 expandcollapse popupDim $input ;Loop until they hit cancel. While @error <> 1 ;Get input from the scanner $input = InputBox("Andy's Amazing Oven Logger Robot", "Scan Work Order Here:","","",300,130,0,0) ;If we actually scanned something, then proceed. If $input Then If Not ProcessExists("WatchMe.exe") Then Run ("WatchMe.exe") Sleep(1500) ;Activate Keyed import window WinActivate("Microsoft Excel - Oven Log Test") WinWaitActive("Microsoft Excel - Oven Log Test") ;Navigate to top of Work Order column Send("{F5}") Sleep(200) Send("B1") Sleep(200) Send("{ENTER}") ;Navigate to bottom of Work Order Column Send("{CTRLDOWN}{DOWN}{CTRLUP}{DOWN}") ;Input the WorkOrder in Excel Send($input) Sleep(1000) Send("{TAB}") Sleep(1000) EndIf WEnd That's my current code. It doesn't matter what I put where at the end of the code, I can't get anything other than my inputbox to be in the frontground. I want my open excel file to jump to the front after all that code runs. Link to comment Share on other sites More sharing options...
water Posted July 7, 2016 Share Posted July 7, 2016 Welcome to AutoIt and the forum! AutoIt comes with an UDF (User Defined Functions) to work with Excel. To add data to Excel i suggest to use function _Excel_RangeWrite. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
THEgame32 Posted July 7, 2016 Author Share Posted July 7, 2016 My script works fine, I just want the excel document to remain in the forefront. Link to comment Share on other sites More sharing options...
water Posted July 7, 2016 Share Posted July 7, 2016 The Send statement sends data to an active window. As your script works so Excel is the active window until the script ends. Is there another statement that takes the focus? Did you post the whole script? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
THEgame32 Posted July 7, 2016 Author Share Posted July 7, 2016 I posted the entire thing... I assure you, Excel is not active at the end. After I send the Tab and sleep for 1000, the InputBox becomes active again. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 7, 2016 Developers Share Posted July 7, 2016 So which other window sits in front of excel then? Maybe it has the TOPMOST attrib set? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
THEgame32 Posted July 7, 2016 Author Share Posted July 7, 2016 The Inputbox I generated sits on top once my script is done. It's never REALLY done, that box should always be there until I hit cancel... it's just that it always gets put back on time. Link to comment Share on other sites More sharing options...
THEgame32 Posted July 7, 2016 Author Share Posted July 7, 2016 on top* Link to comment Share on other sites More sharing options...
water Posted July 7, 2016 Share Posted July 7, 2016 Then we need more information: Which version of Windows do you run? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted July 7, 2016 Share Posted July 7, 2016 Another question: What does WatchMe.exe do? Could you try without calling this exe? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
THEgame32 Posted July 7, 2016 Author Share Posted July 7, 2016 Same results. WatchMe.exe is just a stand-alone countdown timer. I use Windows 7 Pro Link to comment Share on other sites More sharing options...
Developers Jos Posted July 7, 2016 Developers Share Posted July 7, 2016 You are not giving answers the our questions and we have no idea what you are trying! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
THEgame32 Posted July 8, 2016 Author Share Posted July 8, 2016 haha, how can you say I'm not answering you? I've included ALL of the code for the script. I've tried everything that's been suggested so far. Not sure how to make that any more clear for you. Everything suggested has resulted in the same thing: When the script finishes, my inputbox gui is still on top, EVEN THOUGH IT'S NOT THE LAST THING TOUCHED. I want the excel file to be on top until somebody clicks on my input box again. Link to comment Share on other sites More sharing options...
water Posted July 8, 2016 Share Posted July 8, 2016 When you enter some data into your InputBox and click OK the Inputbox is closed. You then transfer the data to Excel (means Excel is the active window). Then the loop starts again and the InputBox gets created again (means it becomes the active window). To sum it up: WAD You can only solve this problem by creating a GUI. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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