Echo810818 Posted May 5, 2010 Report Share Posted May 5, 2010 I met a problem when I try to activate a macro when a specific Excel file is closed. I used "window Title" --> "Window is closed", and I specify a file name, "Microsoft Excel - TestOpen.xls" (this is get from the Browse automatically). But when I close this file, it cannot activate the macro. But when I change the file name to "Microsoft Excel", it works. Is there anybody can tell me what is the problem? Thank YOU in advance! Quote Link to comment Share on other sites More sharing options...
terrypin Posted May 5, 2010 Report Share Posted May 5, 2010 Welcome to the forum, Echo. I can't get activation by the Window Title method (on opening or closing) to work with any 'document' window. I tried 3 separate applications: Excel 2000, Word 2000, and my text editor, TextPad. It works with the overall application (i.e. closing Excel, Word or TextPad in their entirety) but not these document or 'child' windows. These do appear in the list when using Browse to specify the command, so I don't see what's causing the problem. Can others confirm similar behaviour please? -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Cory Posted May 5, 2010 Report Share Posted May 5, 2010 I just did a quick test and found that activating on window title close worked for Notepad with partial and exact match. With Excel 2010 I can not get it to activate when I close Excel. I tried UltraEdit to see if it was related to MDI but that activated fine. I tested a few apps and it seems the problem is limited to MS Office apps for me. Sounds like Echo should report this as a bug. Terry I think you might be confused about something. MDI (Multiple Document Interface) is what you have when a parent app has windows within that app like a word processor. If they are MDI child objects then this activation will never work for the child but it will for the parent. However in applications like Outlook you will notice that opening an email message opens a non-MDI (normal) window. It should work here. The best way to determine this is if the window appears in the windows picker form. IE whet you get when you click the browse button. Quote Link to comment Share on other sites More sharing options...
terrypin Posted May 5, 2010 Report Share Posted May 5, 2010 I just did a quick test and found that activating on window title close worked for Notepad with partial and exact match. With Excel 2010 I can not get it to activate when I close Excel. I tried UltraEdit to see if it was related to MDI but that activated fine. I tested a few apps and it seems the problem is limited to MS Office apps for me. Sounds like Echo should report this as a bug. Terry I think you might be confused about something. MDI (Multiple Document Interface) is what you have when a parent app has windows within that app like a word processor. If they are MDI child objects then this activation will never work for the child but it will for the parent. However in applications like Outlook you will notice that opening an email message opens a non-MDI (normal) window. It should work here. The best way to determine this is if the window appears in the windows picker form. IE whet you get when you click the browse button. Thanks for the clarification, Cory. Although I still don't see why it doesn't work for such child windows, if they appear in the Browse list? -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Echo810818 Posted May 6, 2010 Author Report Share Posted May 6, 2010 Thank you Terry and Cory! Shall I report this issue? Please keep me posted if any update about this issue. Quote Link to comment Share on other sites More sharing options...
paul Posted May 6, 2010 Report Share Posted May 6, 2010 Thanks for the clarification, Cory. Although I still don't see why it doesn't work for such child windows, if they appear in the Browse list? MDI windows are more like controls than windows. It's difficult to handle MDI windows, even in AutoIt. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 6, 2010 Report Share Posted May 6, 2010 I still don't see why it doesn't work for such child windows, if they appear in the Browse list?But they do not appear in the browse list. This is my point. If I open Word and open 3 documents I only see 1 window title for Word in the browse list. That's why I'm saying this is the best 'test'. However there is an option in Word and Excel to show each document as a separate window. One I personally like. If you opt for this then they will appear on the list but this is not the default behavior. And other apps like Ultra-Edit do not have such an option. Another test for MDI is if the child window can be moved outside the confines of the parent's borders. If not it's likely MDI and will not appear on the browse list. That's why Outlook messages are not MDI because they are independent of the parent window app. Bear in mind I'm actually opening my email messages and not previewing or using the reading pane. Quote Link to comment Share on other sites More sharing options...
terrypin Posted May 6, 2010 Report Share Posted May 6, 2010 But they do not appear in the browse list. This is my point. They do here! Yet the macro doesn't run when that document is closed. That's my point. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Cory Posted May 10, 2010 Report Share Posted May 10, 2010 Shall I report this issue?Please do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.