I trying to open xls/xlsx file with powershell using next code:
$file1 = "D:\ALL_SCRIPTS\Scripts2010\cpyUsrs_from1domainto2\file1.xls"
$ObjEx = New-Object -ComObject Excel.Application
$ObjEx.Visible = $True
$objWb = $objEx.workbooks.open($file1)
$objWorksheet = $objWb.Worksheets.Item(1)
this code working fine on workstation with office 2007 installed.
but i got next error on w/s with office 2010 installed:
Exception calling "Open" with "1" argument(s): "Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))"
At line:20 char:31
View Complete Post