I have the following object that later in my code I want to dispose() IF it exists. Is there a way to find if it exists?
Public objExcel As Excel.Application
The best I could come up with is to put the disposal into a try...catch block like this:
Try
objExcel.dispose()
Catch ex As Exception
'do nothing
End Try
Does anyone have a more elegant, less kludgy method?