Yokes9 Posted February 14, 2013 Share Posted February 14, 2013 I'm trying to send an Esc command to my excel file whenever my GUI gains focus in order to make sure it doesn't have a cell being edited. Or if anyone has a better way of doing this. I want my script to take priority so it completes it read or write. Based off the Notepad example I thought this should work. $TitleSend = "Microsoft Excel - " & $File_Name ; Filename=ExcelName_2_14_2013 ControlSend ("[XLMAIN]","","[CLASSNN:Excel7]",{esc}); ControlSend("[CLASS:Notepad]", "", "Edit1", "This is a line of text in the notepad window") Window info >>>> Window <<<< Title: Microsoft Excel - ExcelName_2_14_2013 Class: XLMAIN Position: -9, -9 Size: 1938, 1050 Style: 0x15CF0000 ExStyle: 0x00000110 Handle: 0x005F06BC >>>> Control <<<< Class: EXCEL7 Instance: 1 ClassnameNN: EXCEL71 Name: Advanced (Class): [CLASS:EXCEL7; INSTANCE:1] ID: Text: ExcelName_2_14_2013 Position: -11, 139 Size: 1938, 886 ControlClick Coords: 401, 504 Style: 0x56CF0000 ExStyle: 0x00000300 Handle: 0x00040B8E >>>> Mouse <<<< Position: 390, 634 Cursor ID: 0 Color: 0xFFFFFF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Status Bar Status Bar Ribbon Ribbon ExcelName_2_14_2013 Vertical Horizontal >>>> Hidden Text <<<< Vertical MsoWorkPane I suck at programming... But I try really hard! :imwithstupid: Link to comment Share on other sites More sharing options...
water Posted February 14, 2013 Share Posted February 14, 2013 Do you want to completely disable editing of cells by the user? 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...
Yokes9 Posted February 14, 2013 Author Share Posted February 14, 2013 (edited) No I would like them to be able to edit them when the gui doesn't have focus. If I disable editing while a cell is selected for editing while it unselect it? Edit type-o: will it* Edited February 14, 2013 by Yokes9 I suck at programming... But I try really hard! :imwithstupid: Link to comment Share on other sites More sharing options...
water Posted February 14, 2013 Share Posted February 14, 2013 No. To disable diting is a global setting of the Excel application. Setting focus to the GUI is being done by the user? 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...
Yokes9 Posted February 14, 2013 Author Share Posted February 14, 2013 Yep they will switch to the GUI and push a button on it in order for it to read or write data to the excel sheet. I suck at programming... But I try really hard! :imwithstupid: Link to comment Share on other sites More sharing options...
water Posted February 14, 2013 Share Posted February 14, 2013 (edited) Or you could simply do something like this: WinActivate("Excel_window_title") ; Activate the Excel window WinWaitActive("Excel_window_title") ; Wait until the Excel window is active Send("{ESCAPE}") WinActivate("Your GUI") ; Activate your GUI WinWaitActivate("Your GUI") ; Wait until your GUI is active Edited February 14, 2013 by water 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...
Yokes9 Posted February 14, 2013 Author Share Posted February 14, 2013 I can make that work for me. Thanks for the help. I suck at programming... But I try really hard! :imwithstupid: Link to comment Share on other sites More sharing options...
water Posted February 14, 2013 Share Posted February 14, 2013 If you have further questions or run into a problem you know where we are 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