How can I save an Excel-file, which I'd edit with VB.NE, to a file, which already exists? Evertime there is a dialog: File already exists. Do you really want to overwrite? YES|NO|Abort
How can I overwrite without this dialog?
How can I save an Excel-file, which I'd edit with VB.NE, to a file, which already exists? Evertime there is a dialog: File already exists. Do you really want to overwrite? YES|NO|Abort
How can I overwrite without this dialog?
I resolve this issue by using the Object.Save() method instead. I tried to use the SaveAs method even with the DisplayAlerts = $false but it still kept giving me the overwrite warning.
Code Snippet Below:
There is a property within the
SaveFileDialog
class, calledOverwritePrompt
, set that to false.Hope this helps.
Couldn't you try to delete the file first, before overwriting it?
You should have a look at setting
Application.DisplayAlerts Property
Just remember to reset it to true once you are done.
We currently do it as follows
I solved the problem setting the third parameter of xlApp.Workbooks.Open to false when you create the workbook. That is the readonly argument and if it is set to true it will ask for saving file.