By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,441 Members | 998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,441 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Jul 3 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On Jul 3, 12:58 am, None <chaitu.sunk...@gmail.comwrote:
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

Jul 3 '07 #2

P: n/a
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).
Jul 3 '07 #3

P: n/a
On Jul 3, 7:29 am, None <chaitu.sunk...@gmail.comwrote:
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

Jul 3 '07 #4

P: n/a
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).

Jul 3 '07 #5

P: n/a
On Jul 3, 8:44 am, None <chaitu.sunk...@gmail.comwrote:
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

Jul 3 '07 #6

P: n/a
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.
Jul 4 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more Visual Basic .NET Questions on Bytes