在终端服务器上关闭 Excel 文件时,它会保存到与原来位置不同的位置

When closing an Excel file on a terminal server it saves to a different location than it was in

在我们的组织中,保存 Excel 文件时出现问题。 每当我们关闭一个文件时,它有 50/50 的机会保存在它已经存在的位置,但其他时候它保存在上次保存另一个文件的位置。

我们都在使用 Office 2019 在终端服务器 (Windows 2019) 上工作。

有没有其他人也偶然发现了这个?也许找到了解决方案?

Considerations for server-side Automation of Office 文章陈述如下:

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.

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.

如果您只处理打开的 XML 文档,我建议您改用 Open XML SDK,有关详细信息,请参阅 Welcome to the Open XML SDK 2.5 for Office