• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to answer pop up window

fitz68

New Member
I have a macro that opens an excel file every day. When that excel file opens a pop up window opens that has a message you are required to hit an "Acknowledge" button. I would like to the macro to automatically "click" that acknowledge button, so I don't have to do that every times it opens.


I believe this should be a fairly easy solution, just not that advanced with macros. Any help would be much appreciated!
 
Hi ,


Senthil's suggestion is probably overkill !


Can you go through your code and see whether there is a MSGBOX statement in the code , which displays the message against which you need to press an "Acknowledge" key ? If you can find such a line in the macro , commenting out that particular line should prevent the message box from popping up.


Commenting a line of code is done by inserting a single-quote ' at the beginning of the line of code ; thus , assuming your macro has a line of code as follows :

[pre]
Code:
MsgBox "File has been opened , press any key to continue ..." , vbInformation
inserting a single-quote ' at the beginning of the above line , as shown below :

'  MsgBox "File has been opened , press any key to continue ..." , vbInformation
[/pre]
will prevent the line of code from executing ; your irritating message box will no longer pop up.


Narayan
 
More fuel for the fire...

If the message box is being triggered by a macro within the workbook being opened by another macro, you might possibly want to turn off event macros (assuming it's a Workbook_Open event that's causing the message. Would look something like:

[pre]
Code:
Application.EnableEvents = False
Application.Open "MyBook.xls"
Application.EnableEvents = True
[/pre]
 
Hi, senthilkumar_rm!

A little more fuel to the fire... (inspirated by Luke M's post):

If nothing of the above works, try this:

1) replace your mouse by this http://inventosabsurdos.com/2007/11/26/estpido-mouse-en-forma-de-pistola/ and set wallpaper to a workbook's developer photo (only for use in idle time)

2) replace your mouse by this http://theairmouse.com/tech.php (only for use in work time)

3) replace your mouse by this http://www.tecnoaccesible.net/content/infoot-%E2%80%93-mouse-de-pie-usb (only for use when hands busy)

Regards!
 
Back
Top