ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File available for editing notification (https://www.excelbanter.com/excel-programming/323429-file-available-editing-notification.html)

Charles Evans

File available for editing notification
 
Hi,

I have an c# application that opens Excel files and performs read and write
operations. The application ensures that the excel file used for writing is
not read only (ReadOnly property of the workbook must be false). When I
open a file manually and then try open it through the system, the
application can determine that it is read-only and I can send this error to
the user and close the workbook (Workbook.Close( false, Missing.Value,
Missing.Value) ). The problem arises when I close the manually opened copy
of the file. Excel still thinks I'm wanting to use this file even though
i've explicitly closed it and presents the user with a message stating that
the file can now be opened with read-write access. Clicking the accept or
cancel button on this Excel dialog causes the Excel object from my
application to become visible. The user could then possibly close this and
cause serious havoc in the application.

I've managed to set some properties on the Excel application to prevent the
user closing the Excel window but I would prefer if the notification window
didn't get shown to the user at all. Is this at all possible?

TIA,
Charles





All times are GMT +1. The time now is 11:36 PM.

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