$FilePath = "D:\path\book1.xlsx"
$SheetName = "Sheet1"
$objExcel = New-Object -ComObject "Excel.Application"
$WorkBook = $objExcel.Workbooks.Open($FilePath)
I am using Powershell 5 to read an Excel file, Office 365 based Excel is installed on my windows 10 machine.
The first statement itself fails. What should I look to fix it?