Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default avoiding dialog boxes in macros

I have a script that I'm working on that, among other things may try and
write a file that already exist. Currently, it pops up a dialog box and
stalls the process. I'd like to not have the dialog boxes come up, but
rather simply overwrite the file. What option(s) do I need to specify to
accomplish that goal?

Bruce

--
+-------------------+---------------------------------------------------+
Bruce Bowler | When your illusions are gone you have ceased to
1.207.633.9600 | live. - Anonymous
|
+-------------------+---------------------------------------------------+

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default avoiding dialog boxes in macros

Application.DisplayAlerts = False
' Your code here to overwrite file.
Application.DisplayAlerts = True

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

I have a script that I'm working on that, among other things may try and
write a file that already exist. Currently, it pops up a dialog box and
stalls the process. I'd like to not have the dialog boxes come up, but
rather simply overwrite the file. What option(s) do I need to specify to
accomplish that goal?

Bruce


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default avoiding dialog boxes in macros

if it is a workbook

Application.DisplayAlerts = False
thisworkbook.SaveAs . . .
Application.DisplayAlerts = True

An alternative is

fName = "C:\Whatever.xls"
On error resume next
kill fname
On Error goto 0
Thisworkbooks.SaveAs fName

--
Regards,
Tom Ogilvy

"Bruce Bowler" wrote in message
...
I have a script that I'm working on that, among other things may try and
write a file that already exist. Currently, it pops up a dialog box and
stalls the process. I'd like to not have the dialog boxes come up, but
rather simply overwrite the file. What option(s) do I need to specify to
accomplish that goal?

Bruce

--
+-------------------+---------------------------------------------------+
Bruce Bowler | When your illusions are gone you have ceased to
1.207.633.9600 | live. - Anonymous
|
+-------------------+---------------------------------------------------+



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
Dialog Boxes stacy05 Excel Discussion (Misc queries) 8 February 5th 08 02:02 AM
Dialog Boxes naiveprogrammer Excel Discussion (Misc queries) 2 October 18th 05 10:30 PM
Dialog boxes webster Excel Discussion (Misc queries) 5 July 9th 05 11:16 AM
avoiding Load/Save Dialog Vishesh Vyas Charts and Charting in Excel 0 June 21st 05 01:37 PM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM


All times are GMT +1. The time now is 05:24 AM.

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"