Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Automatically respond to message box appearing within a VBA macro

Within a macro routine I am creating a .prn file and saving over an exisiting
file. Every morning this macro runs and a prompt appears asking if I am sure
I want to overwrite the existing file. The user must click "Ok" in order for
the routine to continue. Is there some syntax in which the macro will
automatically answer the msg box?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Automatically respond to message box appearing within a VBA macro

try this:
insert:
Applictaion.DisplayAlerts = false
at the star of your code then
Application.DisplayAlerts = true
just before the end sub statement

Mike

-----Original Message-----
Within a macro routine I am creating a .prn file and

saving over an exisiting
file. Every morning this macro runs and a prompt appears

asking if I am sure
I want to overwrite the existing file. The user must

click "Ok" in order for
the routine to continue. Is there some syntax in which

the macro will
automatically answer the msg box?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Automatically respond to message box appearing within a VBA macro

try:

Application.DisplayAlerts = False
'
' your code
'
Application.DisplayAlerts = True

Regards

Trevor


"Daniel75" wrote in message
...
Within a macro routine I am creating a .prn file and saving over an
exisiting
file. Every morning this macro runs and a prompt appears asking if I am
sure
I want to overwrite the existing file. The user must click "Ok" in order
for
the routine to continue. Is there some syntax in which the macro will
automatically answer the msg box?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Automatically respond to message box appearing within a VBA macro

MikeW and Trevor Shuttle, you both answered the question wonderfully.
Thanks, you saved 5 keystrokes performed every morning!

"Daniel75" wrote:

Within a macro routine I am creating a .prn file and saving over an exisiting
file. Every morning this macro runs and a prompt appears asking if I am sure
I want to overwrite the existing file. The user must click "Ok" in order for
the routine to continue. Is there some syntax in which the macro will
automatically answer the msg box?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
can I stop the EULA message appearing every time I start Excel? PaulG Excel Discussion (Misc queries) 2 March 9th 07 12:04 PM
toolbar automatically appearing Gus Excel Discussion (Misc queries) 1 January 24th 05 10:44 PM
Error Message Appearing JaneC Excel Discussion (Misc queries) 1 December 6th 04 11:40 PM
Error Message appearing when saving a file JaneC Excel Discussion (Misc queries) 0 November 25th 04 10:35 PM
macro to respond to clipboard prompt? gary Excel Programming 4 September 15th 03 03:59 AM


All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"