Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Overwriting an existing workbook without having to click yes in the prompt box

I want my macro to save a workbook called "accounts.xls", however I
may already have run the macro in which case I wish to over-write the
existing workbook.

If the file has already been saved under that name, the following
Excel dialogue box appears:

"do you wish to over-write the existing file?" in which I have to
click "YES"

I want the macro to find out whether a file called "accounts.xls"
already exists and, if so, delete it, so that the macro can save it
without the need for this Excel prompt box to appear.

Any ideas?

Thanks.

Ian M
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Overwriting an existing workbook without having to click yes in the prompt box

Ian, try this it will not ask you if you want to over-write it will just do
it

Application.DisplayAlerts = False
'Your Code
Application.DisplayAlerts = True


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Ian M" wrote in message
m...
I want my macro to save a workbook called "accounts.xls", however I
may already have run the macro in which case I wish to over-write the
existing workbook.

If the file has already been saved under that name, the following
Excel dialogue box appears:

"do you wish to over-write the existing file?" in which I have to
click "YES"

I want the macro to find out whether a file called "accounts.xls"
already exists and, if so, delete it, so that the macro can save it
without the need for this Excel prompt box to appear.

Any ideas?

Thanks.

Ian M



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Overwriting an existing workbook without having to click yes in the prompt box

Thanks Paul

It works perfectly.

Many thanks for your help.

Kind regards

Ian M



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
When opening existing doc why do I have to click twice to open? vonnie/sellcon Excel Discussion (Misc queries) 2 October 21st 09 05:19 PM
No Save Prompt dialog box when existing (V2003) Mike Excel Discussion (Misc queries) 1 November 28th 07 05:27 PM
Overwriting most of a workbook Brad Excel Discussion (Misc queries) 3 July 2nd 07 02:42 PM
Overwriting an existing Excel workbook Jenni Excel Discussion (Misc queries) 6 January 5th 07 06:32 PM
Write over existing file with no Prompt DNewton Excel Programming 2 April 29th 04 06:54 PM


All times are GMT +1. The time now is 09:26 AM.

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

About Us

"It's about Microsoft Excel"