本文介绍了如何使用Workbooks.add的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在尝试使用以下代码创建新的Excel文件
Hello All,
I am trying to create a new excel file using the below code
static void Main(string[] args)
{
Excel.Application newexcelfile = new Excel.Application();
object newexcel = System.Reflection.Missing.Value;
Excel.Workbook newworkbook = newexcelfile.Workbooks.Add"C:\newfile.xls");
}
但这似乎不起作用.它告诉我该文件不存在.
我用谷歌搜索,找到了答案Excel.Workbook newworkbook = newexcelfile.Workbooks.Add(System.Reflection.Missing.Value);
这似乎可行,但是请您告诉我它是如何工作的.
But this does not seems to work. it tell me that the file is not existing.
I googled about this and i found an answer Excel.Workbook newworkbook = newexcelfile.Workbooks.Add(System.Reflection.Missing.Value);
this seems to work but can you please tell me about how it works.
推荐答案
这篇关于如何使用Workbooks.add的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!