Process cannot access the file because it is being used by another process

N

None

Hi,

I have an application which displays a PDF file on webbrowser control
in Visual Basic. On click of a button this PDF is re-generated and
overwritten. As the PDF is already open following error message comes
while trying to overwrite.

runtime error -2147024864

The Process cannot access the file because it is being used by another
process.

I have solved this issue previously by using "webbrowser.stop"
command. After inserting this statement the error message did not come
up. But now Win XP users are getting the above error again. I have
tested this on my machine (which is a Win XP machine) and it works
fine for me. Not able to figure what problem could be there with the
users XP system.

Can any one please tell me what could be causing the problem (any
security settings with XP or IE etc)..

Thanks,

Nani
 
R

rowe_newsgroups

Hi,

I have an application which displays a PDF file on webbrowser control
in Visual Basic. On click of a button this PDF is re-generated and
overwritten. As the PDF is already open following error message comes
while trying to overwrite.

runtime error -2147024864

The Process cannot access the file because it is being used by another
process.

I have solved this issue previously by using "webbrowser.stop"
command. After inserting this statement the error message did not come
up. But now Win XP users are getting the above error again. I have
tested this on my machine (which is a Win XP machine) and it works
fine for me. Not able to figure what problem could be there with the
users XP system.

Can any one please tell me what could be causing the problem (any
security settings with XP or IE etc)..

Thanks,

Nani

Aren't you wrapping the open code in a try catch? If so the users
shouldn't be seeing any errors at all?

Thanks,

Seth Rowe
 
N

None

once the PDF attachment is received from the server it overwrites the
existing file.
This is when the application throws the run time error (as the
existing file is in opened).
 
R

rowe_newsgroups

once the PDF attachment is received from the server it overwrites the
existing file.
This is when the application throws the run time error (as the
existing file is in opened).

Okay, let me see if I get this or not.

There is a PDF on the server.

The client clicks a button and the PDF is loaded into a webbrowser.

The client clicks a button to reload the PDF and kaboom an error
occurs.

Is this correct?

Thanks,

Seth Rowe
 
N

None

That explanation is way too simple.

I have given such explanation to just explain the error.

In the actual situation a PDF is generated with some parameters on the
server and is sent back to the exe.
This exe displays it on a screen using webbrowser.
The button which is causing the error is used to regenerate the letter
with some user defined data.
When this button is clicked the PDF is regenerated and sent back to
exe. This PDF then overwrites the existing file but cannot succeed as
the file is already open.

I could get rid of the error using webbrowser.stop statement but now
this issue again came up with some XP systems.

And one more thing which I did not mention is ...this issue is
happening only with Adobe 7.0 (not with earlier versions).
 
R

rowe_newsgroups

That explanation is way too simple.

I have given such explanation to just explain the error.

In the actual situation a PDF is generated with some parameters on the
server and is sent back to the exe.
This exe displays it on a screen using webbrowser.
The button which is causing the error is used to regenerate the letter
with some user defined data.
When this button is clicked the PDF is regenerated and sent back to
exe. This PDF then overwrites the existing file but cannot succeed as
the file is already open.

I could get rid of the error using webbrowser.stop statement but now
this issue again came up with some XP systems.

And one more thing which I did not mention is ...this issue is
happening only with Adobe 7.0 (not with earlier versions).

Why not just redirect the webbrowser to "about:Blank" to free the PDF,
update the file, and then switch the url back to the file's location?

Thanks,

Seth Rowe
 
N

None

I know that.

But I just want to find out why is it not working only on a particular
system when it is working on all others.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top