_Workbook::SaveAs(...)

F

Fritz Hilgemann

Hello NG,

I'm certain somebody already encountered this problem (I am using OLE
Automation with VC++):

If I want to save a workbook or worksheet with "SaveAs", and the target file
already exists, I get a MessageBox "This file already exists. Do you
want...". Of course, in an automated program, I don't want to answer message
boxes, instead I always want to override the existing file.
- I cannot find if one of the many parameters to supply with SaveAs controls
this behavior (I experimented with no success).
- Maybe it is an option which needs to be set correctly?

Thanks for any comments
Fritz
 
J

Jim Rech

I don't do VC++ but in VBA Application.DisplayAlerts = False before the
SaveAs suppresses the warning.

--
Jim
| Hello NG,
|
| I'm certain somebody already encountered this problem (I am using OLE
| Automation with VC++):
|
| If I want to save a workbook or worksheet with "SaveAs", and the target
file
| already exists, I get a MessageBox "This file already exists. Do you
| want...". Of course, in an automated program, I don't want to answer
message
| boxes, instead I always want to override the existing file.
| - I cannot find if one of the many parameters to supply with SaveAs
controls
| this behavior (I experimented with no success).
| - Maybe it is an option which needs to be set correctly?
|
| Thanks for any comments
| Fritz
|
|
 
C

Chip Pearson

You can either delete existing file first, or you can set the
Application.DisplayAlerts property to False.


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

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