我在用C#生成excel文档时,最后执行到
sheet.SaveAs("C:\\files\123.xls",Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,);时,
出现了“无法访问文件。请尝试下列方法之一:
确认所指定的文件夹已存在。
确认文件所在的文件夹不是只读的。
确认给出的文件名不包含下列字符:<>?[]:Sheet1.xls或*。
确认文件/路径名长度不超过218个字符。”
的错误提示,请高手指教这是什么问题呢?该如何解决?急~~谢谢!
sheet.SaveAs("C:\\files\123.xls",Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,);时,
出现了“无法访问文件。请尝试下列方法之一:
确认所指定的文件夹已存在。
确认文件所在的文件夹不是只读的。
确认给出的文件名不包含下列字符:<>?[]:Sheet1.xls或*。
确认文件/路径名长度不超过218个字符。”
的错误提示,请高手指教这是什么问题呢?该如何解决?急~~谢谢!
newExcel.Application myErrorBill = new newExcel.ApplicationClass();
newExcel.Workbook ErrorBillBook = myErrorBill.Workbooks.Add(true);
newExcel.Worksheet worksheet = myErrorBill.Sheets[1] as newExcel.Worksheet; string ErrorResult =@"c:\123.XLS";
worksheet.SaveAs(ErrorResult, System.Type.Missing, System.Type.Missing, System.Type.Missing, System.Type.Missing, System.Type.Missing, System.Type.Missing, System.Type.Missing, System.Type.Missing, System.Type.Missing);
ErrorBillBook.Save();