I have a Sub checking if a process name is listed in a listbox and if it exists it does some things, so i am checking the list of open processes looking for ones that have a window title.
Dim ProcCheck() As Process
Dim MyProcCheck As Process
ProcCheck = Process.GetProcesses
For ProcIndex = 0 To ProcCheck.Length - 1
MyProcCheck = ProcCheck(ProcIndex)
If MyProcCheck.MainWindowTitle = "" Then Continue For
If I stop the code and read MyProcCheck variable at any point there is some errors for every process contained in this variable. Below is a picture of some of the errors that are shown.
there are some other errors higher up in the list.
ExitCode = 'MyProcCheck.ExitCode' threw an exception of type 'System.InvalidOperationException'
ExitTime = 'MyProcCheck.ExitTime' threw an exception of type 'System.InvalidOperationException'
These errors are not causing any breaking of the code, they only show inside the dropdown that is in the picture. I tried googling the errors but all i can find is posts pertaining to starting processes. I am only reading the processes that are open already. Should I be worried about this ? thanks for any help you can give
Edit:
The Answer this question is linked with doesn't answer this question, it only explains a little more what the error being received is about. It is in no way a duplicate of the question I asked.