Skip to main content

Issues with automation of Office Products

  • September 17, 2024
  • September 3, 2026 at 8:44 PM
  • 0 replies
  • 31 views

Forum|alt.badge.img

What is the issue?

You may encounter some issues when trying to automate some functions with Office Products.

Below an example of the issue:

EXAMPLE: Unable to get the SaveAs property of the Workbook class At C:\ProgramData\OpConxps\MSLSAM\Temp\TEST_PowerShellScript.ps1:195 char:1 + $ActiveWorkbook.SaveAs($outputExcel) + + CategoryInfo : OperationStopped: (:) [], COMException + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

How to solve it?

It can happen in some situations where the user who starts the Excel is a system user. Excel expects the existence of the Desktop directory. To enable the command to work try the following :

For x64 processes create the following folders :

  • C:\Windows\SysWOW64\config\systemprofile\Desktop
  • C:\Windows\System32\config\systemprofile\Desktop