且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Powershell Excel 自动化 - 在计划任务中保存/打开失败

更新时间:2022-12-01 21:55:46

我记得必须在 C# 应用程序中做类似的事情,当你在 Visual Studio 上构建它时运行良好,但在 CI 服务器上的服务下运行失败.我认为这是 Office 自动化本身的局限性,Microsoft 根本不建议/支持这样做,请在此处查看有关 Office 服务器端自动化的注意事项 - http://support.microsoft.com/kb/257757.它显示了问题和替代方案.

I remember having to do something similar in a C# application, which went well when you build it on Visual Studio, but running under a service on the CI server failed. This I believe is the limitation of Office Automation itself and Microsoft doesn't recommend / support doing this at all Look at Considerations for server-side Automation of Office here - http://support.microsoft.com/kb/257757. It shows the problems and the alternatives.

就我而言,我不得不放弃 Office Interop,而使用 EPPlus ( http://epplus.codeplex.com/ ) 使用 excel.它工作得很好,而且速度也快得多.

In my case, I had to give up Office Interop, and use EPPlus ( http://epplus.codeplex.com/ ) to work with excel. It worked great and was much faster as well.