I'm currently having an issue with VB.Net and Adobe Acrobat. The issue comes from exiting Acrobat but the Windows Taskbar still states that there is an Acrobat.exe process open. I have tried using Marshal.ReleaseComObject(), but it still hangs there. I do not want to have to rely on the "End Process" option on the Task bar in order to remove it.
Below is a snippet of the code that I am try to using:
Try
'Tries To Close Acrobat Application
acrobatApp.Exit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(javaScriptObj)
javaScriptObj = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(acroPDDoc)
acroPDDoc = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(acrobatAVDoc)
acrobatAVDoc = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(acrobatApp)
acrobatApp = Nothing
'Below is a snippet of code that I found for garbage collecting, but it did not work
'GC.Collect()
'GC.WaitForPendingFinalizers()
Catch ex As Exception
'Acrobat Could Be Closed Already
End Try
Although I am not sure if this could be a problem - I run a javascript saveAs script on the Acrobat side in order to make a copy of the file. This also could be a reason why it is hanging, but I ruled it out based on basic knowledge of saving files and exiting from other Acrobat/Microsoft Programs.
Any Help would be beneficial! Thanks!
Edit: -I forgot to mention that Acrobat only closes when my application ends. (Currently) I am trying to make it consider the case if a user manually closes the Acrobat application.