How come I got this error?

Occasional Contributor

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

@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