Re: Overwriting an existing Excel workbook
- From: b.engelbrecht@xxxxxxxxx
- Date: 5 Jan 2007 10:32:47 -0800
I have re-tested, and you are right about the AlertBeforeOverwriting
not making any difference (as it shouldn't). Actually, on my machine I
*always* got an overwrite prompt from VBA with the test code that I
tried. It works properly from the Interop in C#, I stupidly assumed
that my tinkering with the global flag did that.
Dave Peterson schreef:
From xl2003's help for AlertBeforeOverwriting...
True if Microsoft Excel displays a message before overwriting nonblank cells
during a drag-and-drop editing operation. Read/write Boolean.
That's the setting you can toggle via Tools|Options|Edit tab|under the allow
cell drag and drop box.
I've never seen xl2003 show the warning prompt when I've used
"application.displayalerts = false"
And the Conflictresolution setting has to do with shared workbooks. If the
workbook isn't shared, this won't have any effect.
Also from xl2003's help for the ConflictResolution Property:
Returns or sets the way conflicts are to be resolved whenever a shared workbook
is updated. Read/write XlSaveConflictResolution.
XlSaveConflictResolution can be one of these XlSaveConflictResolution constants.
xlLocalSessionChanges. The local user's changes are always accepted.
xlOtherSessionChanges. The local user's changes are always rejected.
xlUserResolution. A dialog box asks the user to resolve the conflict.
b.engelbrecht@xxxxxxxxx wrote:
In Excel 2003 you need to set this before calling SaveAs:
DisplayAlerts = False
AlertBeforeOverwriting = False
In this Excel version, DisplayAlerts = False does not suppress the
overwrite warning. To make very sure that you are never prompted, it is
recommended that you also use the ConflictResolution parameter of
SaveAs, like this:
ActiveWorkbook.SaveAs Filename:="name to be used",
FileFormat:=xlNormal, ConflictResolution:=xlLocalSessionChanges
Best regards,
Berend
Dave Peterson schreef:
Do the "if yes" suggestion.
Jenni wrote:
Yes in my macro would be great but if that cannot be done I was hoping there
is a way for me to "turn off" that warning temporarily while I run my macro.
"Dave Peterson" wrote:
You mean in your macro?
If yes:
application.displayalerts = false
'your code to do .saveas
application.displayalerts = true
If you mean when you use file|saveas, I don't think so.
Jenni wrote:
When I "save as" and overwrite an existing workbook I get the prompt "are you
sure you want to overwrite" is there any way to not get that prompt? To just
overwrite without warning?
--
Dave Peterson
--
Dave Peterson
--
Dave Peterson
.
- References:
- Re: Overwriting an existing Excel workbook
- From: b . engelbrecht
- Re: Overwriting an existing Excel workbook
- From: Dave Peterson
- Re: Overwriting an existing Excel workbook
- Prev by Date: Re: excel SUM function - can it be limited to whats in parentheses?
- Next by Date: Re: Transpose data Months & Data to Rows
- Previous by thread: Re: Overwriting an existing Excel workbook
- Next by thread: Re: Shade a cell
- Index(es):
Relevant Pages
|
|