Question How to get Webbrowser to release file

bwwilson

New member
Joined
Dec 1, 2009
Messages
3
Programming Experience
Beginner
Hello,
I am writing my first vb.net program that displays a .pdf file in a webbrowser control. I have setup a routine that moves the file to a different folder. The problem is I get the following error: "The process cannot access the file because it is being used by another process." Is there a way to release the file from the webbrowser so that I can move the file.
Thanks,
Bruce
 
VB.NET:
Me.WebBrowser1.Navigate("about:blank")
Do Until Me.WebBrowser1.ReadyState = WebBrowserReadyState.Complete
    Application.DoEvents()
Loop
 
Hi,
Thanks for the reply. I tried the code you posted and got the same error message. This seemed like such a great fix.
 
I tried it also and had no problems moving the hosted pdf after that. I have no other suggestions.
 
Acrobat.exe is the culprit

It's a new day so I thought I'd take a wack at getting my program to work again. With the code to go to a blank page and wait until the execution was complete in place, I tried it again, with the same result. I brought up task manager and killed the Acrobat.exe task and the file is released and I can move the file to its destination folder. So I guess the question is, how do I kill the Acrobat.exe process along with navigating to a blank page.
Thanks,
Bruce
 
Back
Top