excel文件自动存储在c文件夹中,我的代码如下 [英] excel file automatically store in c folder forthat my code as follows
问题描述
我需要一个excel文件存储在c文件夹中。因为我编写了如下代码;
xlWorkBook。 SaveAs(@C:\ _Csharp.net-informations.xls);
但是当我运行它时显示错误如下;
方法''SaveAs''没有重载需要''1''参数。
$ b从我的代码$ b是什么错误。如何在c文件夹中自动保存excel文件。任何其他代码都可以保存在c文件夹中。
帮助我。我尝试了上面的代码但是没有用。
i need an excel file to be store in c folder.for that i written the code as follows;
xlWorkBook.SaveAs(@"C:\Csharp.net-informations.xls");
but when i run it shows the error as follows;
No overload for method ''SaveAs'' takes ''1'' arguments.
from my code what is the mistake. how can i do to save an excel file automatically in c folder. any other code is there to save it in c folder.
help me. i tried my above code but is not working.
推荐答案
试试这个:
Try this:
object oMissing = System.Reflection.Missing.Value;
xlWorkBook.SaveAs(@"C:\Csharp.net-informations.xls",
XlFileFormat.xlExcel8, oMissing, oMissing, oMissing, oMissing, XlSaveAsAccessMode.xlNoChange, oMissing,
oMissing, oMissing, oMissing, oMissing);
>
如果您查看 http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.saveas%28v=vs.100%29.aspx [<一个href =http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.saveas%28v=vs.100%29.aspxtarget =_ blanktitle =New窗口> ^ ],您会注意到许多参数与 SaveAs
方法相关联。
If you look at the method description at http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.saveas%28v=vs.100%29.aspx[^], you will notice a number of parameters are associated with the SaveAs
method.
这篇关于excel文件自动存储在c文件夹中,我的代码如下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!