Jump to content

Excel and Word Save Window - Not Detectable - (Moved)


Go to solution Solved by Sly01,

Recommended Posts

Posted

Hi Everyone,

I'm trying to interact with those if they pop. (They should not pop because of the way we use our systems, but it looks like some time it may appear)

When I use AutoIT Window Info it just gives me some GUI Class which I cannot trigger because it's too generic.

How can I cancel that window? or make it not save?

image.png.8f7585c00aaf927db33592706e37f4a8.png

  • Moderators
Posted

Moved to the appropriate forum.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

You could get the right Excel window with something like this :

HotKeySet("^!{END}", Terminate) ; ctrl-alt-end
Local $hWnd
While Sleep(10)
  $hWnd = WinGetHandle("[TITLE:Microsoft Excel; CLASS:#32770]", "Want to save your changes to")
  If $hWnd Then
    ConsoleWrite($hWnd & @CRLF)
    ControlClick($hWnd, "", "Button2")
  EndIf
WEnd

Func Terminate()
  Exit
EndFunc

ps. tested on my french machine and working flawlessly with french text

  • 1 month later...
Posted
On 12/5/2023 at 2:33 PM, Nine said:

You could get the right Excel window with something like this :

HotKeySet("^!{END}", Terminate) ; ctrl-alt-end
Local $hWnd
While Sleep(10)
  $hWnd = WinGetHandle("[TITLE:Microsoft Excel; CLASS:#32770]", "Want to save your changes to")
  If $hWnd Then
    ConsoleWrite($hWnd & @CRLF)
    ControlClick($hWnd, "", "Button2")
  EndIf
WEnd

Func Terminate()
  Exit
EndFunc

ps. tested on my french machine and working flawlessly with french text

Hi :) Merci 

But how could you find the CLASS:#32770

When I use AutoIT Window Info I get NOTHING 

Posted

@Sly01 Please do not quote the post you reply to. We know what we have written.
Simply scroll down to the end of the thread and add the new post in the edit field :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

 

Posted (edited)

@Nine Misuse Au3Info... Seriously? How could you misuse it... Click and point hahaha ;o) 

What version of Office are you using?

The save window give me no details at all, No Classe no nothing no text

I've used it for all my other error messages I take care of, I wouldn't see what I am doing different there... 

Unless there is another trick the point and click that I've never used

Edited by Sly01
Posted
31 minutes ago, Nine said:

image.gif.ea907103c2ccb9e1b36b098c8209a424.gif maybe the freeze option bluffed you.

ps. it's an old version of Office (2012)

Yes exactly what I thought ... Windows 2016 and Office 365 don't have the same details... It's really weird

Posted
>>>> Window <<<<
Title:  Microsoft Word
Class:  NUIDialog
Position:   657, 444
Size:   366, 122
Style:  0x94C80000
ExStyle:    0x00000101
Handle: 0x00000000001F044A

>>>> Control <<<<
Class:  NetUIHWND
Instance:   1
ClassnameNN:    NetUIHWND1
Name:   
Advanced (Class):   [CLASS:NetUIHWND; INSTANCE:1]
ID: 
Text:   
Position:   0, 0
Size:   350, 83
ControlClick Coords:    159, 15
Style:  0x56000000
ExStyle:    0x00000000
Handle: 0x00000000000D045E

>>>> Mouse <<<<
Position:   824, 490
Cursor ID:  0
Color:  0xF0F0F0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<


>>>> Hidden Text <<<<

Here you can see attached, that's the only thing I am able to pick

2024-01-10 17_13_35-Window.png

Posted

Another approach is to use "Events".  A function  gets called when a specific event (like saving or closing a document) is raised. You can then cancel the event or save the document.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

 

Posted
13 hours ago, Nine said:

Seems that classnn has changed.  Try with this new name.  Remove text.  

Show me what you have tried that is not working...

I tried to WinActivate using the classes, but it doesn't seem to work

WinActivate("[CLASS:NetUIHWND]") and WinActivate("[CLASS:NUIDialog]") and WinActivate("Microsoft Word", "[CLASS:NUIDialog]")

Nothing seem to activate it. Other than that, I have no idea what I can try...

Beyond my small knowledge

10 hours ago, water said:

Another approach is to use "Events".  A function  gets called when a specific event (like saving or closing a document) is raised. You can then cancel the event or save the document.

What do you mean by Events? Sorry I never worked with those as of yet...

But bear in mind that this is an automation computer, there is no real interaction with humans. This SAVE is actually a problem it should not happen. This is a Document that is being printed through Microsoft Word through command line, and probably the document is malformed, when the print is over and Microsoft word is trying to exit it detects it "fixed" something in it, then ask to save the changes.

  • Solution
Posted

Thanks for your help, here is how I found how to do it.

Opt("WinTitleMatchMode", 4)
$WindowHandle = WinGetHandle("[TITLE:Microsoft Excel; CLASS:NUIDialog]","")
WinActivate("$WindowHandle")
Sleep(1000)
Send("n")

Excel was a bit more tricky, because in the case I have... 

Application Sending Print Job to Excel > Excel Opening for Printing > Send Print Job > At whatever point the file was modified and when Excel is trying to close after the print, detects the changes ask to save
 

But the Save Dialog is not popping up automatically, you have to "Click" on excel wait for a few seconds and THENNNNN only the Save Dialog appears.

So I had to add change it a little bit for Excel:

Opt("WinTitleMatchMode", 2)
WinActivate("Excel")
Sleep(5000)

Before doing my check for windows or errors, I made sure to Activate Excel with whatever windows there is wait 5 seconds to give it time to show, and then I let my script running

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
  • Recently Browsing   0 members

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