I have a wpf application and I am saving an Excel file using following code. If I select the file path as "C:\" it throws an error. No other file path has this issue.
Please help.
excelWorkbook.SaveAs(saveAsPath, XlFileFormat.xlWorkbookNormal, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
EDIT
File name: C:\2347_H4141001_axm2312_20110627_042821.xls
The error is:
The file could not be accessed. Try one of the following:
• Make sure the specified folder exists.
• Make sure the folder that contains the file is not read-only.
• Make sure the file name does not contain any of the following characters: < > ? [ ] : | or *
• Make sure the file/path name doesn't contain more than 218 characters.