abhiker
01-13-2009, 02:02 PM
I am writing out an XML file from my Excel workbook and i do not get a warning if i am about to overwrite an existing file. I am using the following code to write the file. Any suggestions or changes to get the overwrite warning would be appreciated.
Dim objFSO As FileSystemObject
Set objDoc = New DOMDocument
fn = Application.GetSaveAsFilename _
(strQ, "XML Files (*.xml),*.xml", , "Save XML Query")
If fn <> False Then
Call objDoc.Save(fn)
MsgBox ("File saved to: " & fn)
Else
MsgBox ("WARNING: File Not saved!!")
Exit Sub
End If
Dim objFSO As FileSystemObject
Set objDoc = New DOMDocument
fn = Application.GetSaveAsFilename _
(strQ, "XML Files (*.xml),*.xml", , "Save XML Query")
If fn <> False Then
Call objDoc.Save(fn)
MsgBox ("File saved to: " & fn)
Else
MsgBox ("WARNING: File Not saved!!")
Exit Sub
End If