Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default SaveAs and always overwrite?

I have an Access VBA script that uses XL to create a small workbook and then
save it. It is not uncommon to run it a couple of times a day, but every time
we do it puts up a dialog asking if you want to overwrite it?

Is there any way to turn this off? Is ConflicResoution the way? It doesn't
seem to be. If it is, how do I decode the enum into a real int value?

Maury
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default SaveAs and always overwrite?

You can set the DisplayAlerts property to False to prevent the
overwrite confirmation message. E.g.,

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "H:\book1.xls"
Application.DisplayAlerts = True

Since the script is running under Access, change 'Application' to
your variable which references the Excel application.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Maury Markowitz"
wrote in message
...
I have an Access VBA script that uses XL to create a small
workbook and then
save it. It is not uncommon to run it a couple of times a day,
but every time
we do it puts up a dialog asking if you want to overwrite it?

Is there any way to turn this off? Is ConflicResoution the way?
It doesn't
seem to be. If it is, how do I decode the enum into a real int
value?

Maury



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default SaveAs and always overwrite?

"Chip Pearson" wrote:

You can set the DisplayAlerts property to False to prevent the
overwrite confirmation message. E.g.,


Thanks, I'll try that out tonight.

Maury
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default SaveAs and always overwrite?

Inside excel's VBA, I'd do this:

application.displayalerts = false
myworkbook.saveas ....
application.displayalerts = true



Maury Markowitz wrote:

I have an Access VBA script that uses XL to create a small workbook and then
save it. It is not uncommon to run it a couple of times a day, but every time
we do it puts up a dialog asking if you want to overwrite it?

Is there any way to turn this off? Is ConflicResoution the way? It doesn't
seem to be. If it is, how do I decode the enum into a real int value?

Maury


--

Dave Peterson
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
overwrite SP[_3_] Excel Programming 2 April 22nd 05 06:15 PM
Q: overwrite during saveas JIM.H. Excel Discussion (Misc queries) 1 January 5th 05 07:27 PM
Method SaveAs with no overwrite YesNoCancel dialog Peter Pham Excel Programming 1 July 16th 04 09:28 PM
Using SaveAs Statement to overwrite existing File Peter Excel Programming 3 June 16th 04 12:27 PM
overwrite Excel SaveAs function from File menu susie Excel Programming 1 July 31st 03 04:47 AM


All times are GMT +1. The time now is 06:01 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"