Here is my code:
SaveFileDialog sd = new SaveFileDialog();
sd.Title = "Select Excel Sheet to Export or Create New !";
sd.Filter = "Excel files (*.xls)|*.xls";
sd.FilterIndex = 0;
sd.ShowDialog();
if (sd.FileName != null)
{
AddWorksheetToExcelWorkbook(sd.FileName);
}
Here is a simple 10 lines of code which i have been using for a very long time never any issue, but recently i am using this but i get error when i need to write to the file as below:
filename.. could not be found. Check the spelling of the file name, and verify that the file location is correct.
See image below its what we do , write filename and click save button , i only get error if i am making a new file not when i select existing.
Why is this happening i have used this code many times, also i see there is no file created on the folder i save it to so why is the SaveFileDialog
not saving files am i missing something?
UPDATE :
Work's fine if i select an already existing file issue only when i write name and press save.