您的问题归结为“我可以安全地使用Excel自动化API吗?”并且与服务器细节几乎没有关系.当然,Excel确实在Windows Server平台上运行,它甚至是终端服务器环境中的一种相当常见的场景,但通常由相应的用户以交互方式运行.以这种方式运行它一直是安全的(即旧版本也被放在终端服务器上).
话虽如此,已于2010年7月2日修订的KB257757以及明确列出“Microsoft Excel 2010”的“适用于”部分,声明:
Microsoft does not currently recommend,and does not support,Automation of Microsoft Office applications from any unattended,non-interactive client application or component (including ASP,ASP.NET,DCOM,and NT Services),because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
特别是在许可问题上:
Current licensing guidelines prevent Office applications from being used on a server to service client requests,unless those clients themselves have licensed copies of Office.
最后用粗体表示:
Microsoft strongly recommends a number of alternatives that do not require Office to be installed server-side,and that can perform most common tasks more efficiently and more quickly than Automation. Before you involve Office as a server-side component in your project,consider alternatives.
我相信你不能有一个比这更明确的陈述.