Jump to content

Excel Control Send


Yokes9
 Share

Recommended Posts

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

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 - 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 (NEW 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

 

Link to comment
Share on other sites

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 by Yokes9

I suck at programming... But I try really hard! :imwithstupid:

Link to comment
Share on other sites

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 - 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 (NEW 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

 

Link to comment
Share on other sites

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 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 - 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 (NEW 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

 

Link to comment
Share on other sites

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 - 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 (NEW 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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...