ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   File Sharing Violation (https://www.excelbanter.com/excel-discussion-misc-queries/183437-file-sharing-violation.html)

Jay

File Sharing Violation
 
Thanks in advance.

My module(not Excel VBA) genrated automatically every two hours an Excel
File (Performance.xls) to a predefined network folder.
Since somebody leave this file open, 'File Sharing Violation' error happens
and it is not being updated at all.

Q1. Is there any way to overwrite even he file is open.
Q2. If not, at leaset to close error dialog box.

Appreciated




Mike

File Sharing Violation
 
You could try setting it as a shared workbook, and set the settings to always
overwrite other users changes (In 2007 its on the "review" tab). You could
also change the Windows permissions to allow it to open to "read only" for
all other users and "read/write" for you (assuming others won't need to
modify the file).

"Jay" wrote:

Thanks in advance.

My module(not Excel VBA) genrated automatically every two hours an Excel
File (Performance.xls) to a predefined network folder.
Since somebody leave this file open, 'File Sharing Violation' error happens
and it is not being updated at all.

Q1. Is there any way to overwrite even he file is open.
Q2. If not, at leaset to close error dialog box.

Appreciated




Kevin B

File Sharing Violation
 
In addition to Mike's excellent suggestions, you could also run some code to
see if the file is open. The URL below is a link to the Microsoft Office
Knowledge Base and has all the necessary instructions and code to check if a
file is open:

http://support.microsoft.com/kb/213383
--
Kevin Backmann


"mike" wrote:

You could try setting it as a shared workbook, and set the settings to always
overwrite other users changes (In 2007 its on the "review" tab). You could
also change the Windows permissions to allow it to open to "read only" for
all other users and "read/write" for you (assuming others won't need to
modify the file).

"Jay" wrote:

Thanks in advance.

My module(not Excel VBA) genrated automatically every two hours an Excel
File (Performance.xls) to a predefined network folder.
Since somebody leave this file open, 'File Sharing Violation' error happens
and it is not being updated at all.

Q1. Is there any way to overwrite even he file is open.
Q2. If not, at leaset to close error dialog box.

Appreciated





All times are GMT +1. The time now is 06:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com