StuckUser Posted November 20, 2019 Share Posted November 20, 2019 Hello, Hopefully this is a simple answer to what should be a simple question. I have a lot more code to this program, but all I am trying to do is use some error handling for _IETagNameAllGetCollection. If I try whats below, the function error still gets thrown and the program crashes. I cant figure out any other way to try and grab the error. Ultimately what I want to test is whether or not $oElement is of type Object. My program must be run as Admin, if not, $oElement won't be an Object which causes the crash. For $oElement in $oElements If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Admin Error", "This program will now close. Please right click and run as Admin." & @CRLF & "@error = " & @error) Next Link to comment Share on other sites More sharing options...
Subz Posted November 20, 2019 Share Posted November 20, 2019 Use IsObj() Link to comment Share on other sites More sharing options...
StuckUser Posted November 27, 2019 Author Share Posted November 27, 2019 Sorry for the late reply, but thank you. Such a simple answer after all. I had tried VarGetType but not IsObj. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now