Click here to Skip to main content
15,945,119 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
I am using the following statement to save file.
But the problem is if the file already exists i want that file to be replaced without user interupt.Please help.

newworkbook.SaveAs(
    @"c:\test1.xls",
    Excel.XlFileFormat.xlWorkbookNormal,
    "",
    "",
    false,
    false,
    XlSaveAsAccessMode.xlNoChange,
    XlSaveConflictResolution.xlUserResolution,
    false,
    false,
    false,
    true);
Posted

1 solution

Why not just use File.Delete to delete it first if it exists ? Or check the docs to see if one of those 'false' values is for 'overwrite if existing' ?
 
Share this answer
 
Comments
asjadazeez 16-Jul-10 8:06am    
the false values are for other parameters. Deleting the file before saving is an option but that i think is not very neat.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900