visual basic 2013 System.nullreferenceException How to catch a nothing ?

Hello Experts,
my programs opens a site and operates it perfectly only after some five or six good executions it shows the error message shown in the image.

some times the site is faster sending the data and some times its slower, I gues this creates the probem and sometimes the variable v3 is nothing.... until the next iteration.... so how can I catch  a "nothing" without getting an error message ?

Best regards.
RGuillermoProject ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Hi rguillermo;

It is hard to tell from the code that is posted. You can two one of two things if v3 is really Nothing then this should work.
If v3 Is Nothing then 

Open in new window

But if v3 is not the one causing the null reference then this should work.
If v3.activeElement Is Nothing

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RGuillermoProject ManagerAuthor Commented:
Fernando the
If v3.activeElement Is Nothing
Worked perfectly!
Thank you very much!!
Fernando SotoRetiredCommented:
Not a problem rguillermo, glad to help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.