[英]C# Run macro without opening Excel
Is there a way to run a macro using Office Interop without launching the Excel application? 有没有一种方法可以在不启动Excel应用程序的情况下使用Office Interop运行宏?
If i set the Excel application to false it will still show Excel 如果我将Excel应用程序设置为false,它将仍然显示Excel
My code: 我的代码:
private void button1_Click(object sender, EventArgs e)
{
Excel.Application oExcel = new Excel.Application();
oExcel.Visible = false;
oExcel.Run("'c:\\PERSONAL.XLSB'!Module1");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.