Categories: Powershell Windows

Powershell Excel.Application Task Scheduler Automation

Using the Excel.Application com object in Powershell won't save a file through the task scheduler for automation.
It's likely a DCOM permissions issue. Automating Excel is sometimes fraught with peril...
The only way I've found around issues such as this is to set Excel to run as a specific user through DCOM permissions.

Open Component Services (Start > Run, type in dcomcnfg)
If you're using 32bit Excel do this instead from a command prompt:
C:\WINDOWS\SysWOW64>mmc comexp.msc /32
Drill down to Component Services > Computers > My Computer > DCOM Config
Right-click on Microsoft Excel Application and choose Properties
In the Identity tab select This User and enter the user that is running the task in task scheduler

Sources:
http://superuser.com/questions/579900/why-cant-excel-open-a-file-when-run-from-task-scheduler
http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2012/11/12/microsoft-excel-does-not-appear-in-dcom-configuration-snap-in.aspx

Share
Disqus Comments Loading...

Recent Posts

VMWare vSphere 6.7 ESXTOP Output Garbled

If your VMWare vSphere 6.x environment command output of esxtop looks like a bunch of garbled gibberish (it's actually CSV… Read More

February 28, 2019 7:39 pm 19:39

How To Run RoboCopy Backup in Parallel

From time to time Windows Admins will surprise you with band-aid and bubble gum scripts, that's entirely expected I think.… Read More

February 28, 2019 12:20 pm 12:20

Windows 10 GodMode - The Ultimate Administrator Shortcut

Have you ever wondered what life might be like if the Windows 10 OS somehow had a single folder that… Read More

February 28, 2019 7:58 am 07:58

Samsung Galaxy S9 G960/G965 Stock ROM Firmware Download

There could be any number of reasons for needing to flash manufacturer stock OEM firmware on a Samsung Galaxy S9… Read More

January 24, 2019 7:42 am 07:42

Output IP Address with ipconfig Findstr Ethernet Adapter

How many times have you entered  ipconfig /all at the command line to return a single IP address, then have to strain… Read More

January 20, 2019 12:39 am 00:39

AWS SES Assistance in Enterprise Market - A Must Read

Designing e-mail solutions on a large scale can be a complex and costly challenge for a business: you need to… Read More

December 25, 2018 4:01 pm 16:01