I am trying to open an Excel sheet from a server where Office isn't installed. Although, we have Microsoft Excel Driver installed.
I am trying to do something fairly simple: Import into Powershell the data from that Excel sheet.
$Excel = New-Object -Com Excel.Application
$path= '"C:\Users\gpiche001\Desktop\UserList.xlsx';
$openfile= $Excel.workbooks.open($path);
$Sheet= $openfile.worksheets.item(2);
$arrExcelValues = @()
I get the following error:
New-Object : Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
I understand that this is probably caused by Powershell not being able to open Excel. I was wondering how can I make it work by leveraging the MS Excel Driver?
Thanks!