SaveAs and always overwrite?

G

Guest

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
 
C

Chip Pearson

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" <[email protected]>
wrote in message
news:[email protected]...
 
G

Guest

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

Thanks, I'll try that out tonight.

Maury
 
D

Dave Peterson

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top