Forum Discussion

Yuansheng Zhang's avatar
Yuansheng Zhang
Copper Contributor
Jan 29, 2021

How come I got this error?

You cannot call a method on a null-valued expression.
At H:\Test.ps1: 109 char:26 + If ($ie -ne $null) { $ie.Document.parentWindow.scrollTo(0,1300) }

1 Reply

  • farismalaeb's avatar
    farismalaeb
    Iron Contributor

    Yuansheng Zhang 

    Depend on the $ie Object Type.

    Type the following

    $ie.gettype()  #What is the output

    if you type $ie only, what is the output

    it seems that the $ie variable is not holding any value.

    where is the value of $ie from

Resources