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

FreeNAS Error Creating Pool

command '('gpart', 'create', '-s', 'gpt', '/dev/da8')' returned non-zero exit status 1. If you get this error while trying to create… Read More

May 14, 2019 8:22 am 08:22

Change Grub Default Boot Entry on Linux Mint

i'm dual booting windows and linux mint on my laptop. the grub default is to boot into linux mint, however… Read More

April 23, 2019 7:45 pm 19:45

How to Reset Secure Channel On Active Directory Domain Controller

when you're a little too careless about virtualizing your domain controllers, cloning, migrating, backing up and restoring, returning from vacation… Read More

April 21, 2019 8:14 am 08:14

Run SystemD Script Before System Shutdown

for the sheer hell of it, a few weeks ago i wanted to see if i could properly and successfully… Read More

April 20, 2019 10:14 am 10:14

Learn Systemctl Usage to Manage Systemd Service in Linux

systemd is new service manager for linux. it's a replacement for all previous init systems (sysv/sysvinit & ubuntu's upstart) and… Read More

April 20, 2019 7:55 am 07:55

Force Delete Windows Server DHCP Failover Relationship

if you've found yourself here then chances are you messed up one of your domain controllers or at least one… Read More

April 20, 2019 5:54 am 05:54