PowerShell scheduled task to run script with Excel Com Object

前端 未结 2 390
小蘑菇
小蘑菇 2021-01-19 11:48

Here is some strange behavior, I\'ve got a PowerShell script that converts an XLSX file into a CSV file. This script runs in the console without issue.

Trying to sc

2条回答
  •  醉酒成梦
    2021-01-19 12:28

    I don't believe Microsoft supports what you are attempting to do. According to this documentation, Microsoft states:

    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.

    The documentation appears to be for Office 2003, but I'm not sure if they have changed there stance since then as I haven't found other documentation stating support. As recently as 2009, this MVP reiterates that it isn't supported. The recommendations appear to be to use OpenXML SDK for non-interactive automation, or another third party library for working with the file format directly.

提交回复
热议问题