Sign in to follow this  
Followers 0
Yokes9

Excel Control Send

8 posts in this topic

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:

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Yokes9

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I can make that work for me. Thanks for the help.


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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0