PowerShell Error while accessing Excel COM Object

SURESH0518
SURESH0518 used Ask the Experts™
on
I have powerShell script which uses below statement
$xlApp = New-Object -Com Excel.Application

When I try to run the script it gives the following error.

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

Could you tell what is wrong.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Awarded 2012
Commented:
Hi,
afaik this code means: Access denied
Where/how do you run this script?
Can you try to open Powershell / ISE with Administrative privs? (right click -> run as admin)
Do you run the script in 32bit mode (assuming you have Excel not in 64bit installed)
HTH
Rainer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial