Jump to content
Macro Express Forums

Activation-Window is closed


Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...