ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Read and Write Excel file (https://www.excelbanter.com/excel-programming/330857-read-write-excel-file.html)

Robot

Read and Write Excel file
 
I writes contiuonsly to an excel file, after 4 hours I close the file and
start a new. While writing I want to look in the excel file.

wb.Open +=new WorkbookEvents_OpenEventHandler(wb_Open);
wb.BeforeClose +=new WorkbookEvents_BeforeCloseEventHandler(wb_BeforeCl ose);

1) when you open the file it is writing to, it comes up with a message "This
file is already open, do you want to reopen it, and I must press "No".

I would like to avoid the popup message and pressing No by making it in the
program. But which event must I use. I though it used Open, but I am wrong.

2)When I close the file it comes up with the message. Do you want to save
the changes you made. If I press yes or no, my program stops writing !! If I
do nothing
and wait it automatically close the wb. How do I close the file without
interrupting my writing ? I use the event BeforeCloseEventHandler.


All times are GMT +1. The time now is 05:33 PM.

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