In a VB.Net program I am opening an Excel workbook, adding some data,
and then saving the file. My code is:
Dim xlApp As New Excel.Application
Dim wb As Excel.Workbook
Dim ws As Excel.Worksheet
' Code to add data here.
wb.Save()
xlApp.Quit()
xlApp = Nothing
The problem is that sometimes, but not all the time, the call to Save()
pops up a dialog box telling me that the file already exists and asking
if I want to replace it. THis is not supposed to happen with Save().
What could be causing this?

Signature
Peter Aitken
RobinS - 24 Feb 2007 01:43 GMT
> In a VB.Net program I am opening an Excel workbook, adding some data,
> and then saving the file. My code is:
[quoted text clipped - 13 lines]
> if I want to replace it. THis is not supposed to happen with Save().
> What could be causing this?
Well, apparently there is already a file with that name in that location.
Why do you think it's not supposed to happen with Save() ? It's just as if
you hit <Save> on the menu in Excel.
Robin S.