$Excel = New-object -ComObject Excel.application
$Path = "Path"
$Excel.Workbooks.Open($Path)
It works most of the time, but sometimes, like today, is not working.
The error is:
You cannot call a method on a null-valued expression
At line: "x" Char: "s"
$Excel.Workbooks.Open($Path)
Any suggestions?