ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Event for a file being changed? (https://www.excelbanter.com/excel-programming/305777-event-file-being-changed.html)

R Avery

Event for a file being changed?
 
Is there anyway to code an event for a file being changed (or accessed)
in VBA? What I have been doing is setting Excel to read a file every
few seconds to see if it changes, and if it does, take an action.
However, as the time interval between checks shrinks, Excel becomes
increasingly unresponsive and unruly.

However, if there were simply an event that i could trap like
OnFileChanged, then that would keep the Excel UI responsive. Is this
possible?

JE McGimpsey

Event for a file being changed?
 
If by "change" you mean a manual or remote entry, use the
Workbook_SheetChange() event.

Otherwise, what do you expect to be changing?

In article ,
R Avery wrote:

Is there anyway to code an event for a file being changed (or accessed)
in VBA? What I have been doing is setting Excel to read a file every
few seconds to see if it changes, and if it does, take an action.
However, as the time interval between checks shrinks, Excel becomes
increasingly unresponsive and unruly.

However, if there were simply an event that i could trap like
OnFileChanged, then that would keep the Excel UI responsive. Is this
possible?


R Avery

Event for a file being changed?
 
Sorry, I was not clear. I meant how do I get an event when an un-opened
text file is changed?


All times are GMT +1. The time now is 12:00 AM.

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