ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Start my application when a .txt is added to or updated in aparticular directory (https://www.excelbanter.com/excel-programming/402008-start-my-application-when-txt-added-updated-aparticular-directory.html)

[email protected]

Start my application when a .txt is added to or updated in aparticular directory
 
The basics of my application:
It takes a tab delimited .txt file created from exporting a report
from Quicken, and creates an Excel workbook, doing all kinds of
sorting, calculations, and formatting based upon user input.

Besides selecting menu options from my custom menu, I would like to
give the option to run my wizard on the event that a any .txt file in
a specified directory is updated or added.

I have a few ideas based upon all the documentation I've read and
searches I've done:
-Use Automation/OLE to access an object in a system or Quicken
library, and an event associated with that object. I've attached a
few references to other libraries that might have something I could
use. But there are so many I don't know where to start. And I can't
see the newly attached libraries of objects in my object model
reference (not used to my new Excel 2007 environment).
-Something totally different, maybe create a Connection to a
particular .txt file (this way it would only work for one file being
updated rather than a new file created in that directory), and use the
IRTDUpdateEvent.UpdateNotify?
-Could I use the workbook Sync event somehow?

Also, I'd like to somehow keep this small part of the application (the
part that displays a simple dialog box that asks the user if she wants
to run my application for the file that was just created or updated,
upon the event of a file being added or updated in a particular
directory) running/available, without the user opening Excel.

It seems like it would be a common need, to run an event handler
procedure upon the event of a non-Excel file being created or updated,
but I haven't found any questions about it.

I would sure appreciate any advice from someone who has done this or
knows how to do it... thank you.

Dave Peterson

Start my application when a .txt is added to or updated in aparticular directory
 
Maybe...

Use code from Randy Birch's VBNet site to use API calls to watch a folder.
http://www.mvps.org/vbnet
Search for FindChangeNotification.



wrote:

The basics of my application:
It takes a tab delimited .txt file created from exporting a report
from Quicken, and creates an Excel workbook, doing all kinds of
sorting, calculations, and formatting based upon user input.

Besides selecting menu options from my custom menu, I would like to
give the option to run my wizard on the event that a any .txt file in
a specified directory is updated or added.

I have a few ideas based upon all the documentation I've read and
searches I've done:
-Use Automation/OLE to access an object in a system or Quicken
library, and an event associated with that object. I've attached a
few references to other libraries that might have something I could
use. But there are so many I don't know where to start. And I can't
see the newly attached libraries of objects in my object model
reference (not used to my new Excel 2007 environment).
-Something totally different, maybe create a Connection to a
particular .txt file (this way it would only work for one file being
updated rather than a new file created in that directory), and use the
IRTDUpdateEvent.UpdateNotify?
-Could I use the workbook Sync event somehow?

Also, I'd like to somehow keep this small part of the application (the
part that displays a simple dialog box that asks the user if she wants
to run my application for the file that was just created or updated,
upon the event of a file being added or updated in a particular
directory) running/available, without the user opening Excel.

It seems like it would be a common need, to run an event handler
procedure upon the event of a non-Excel file being created or updated,
but I haven't found any questions about it.

I would sure appreciate any advice from someone who has done this or
knows how to do it... thank you.


--

Dave Peterson


All times are GMT +1. The time now is 07:55 PM.

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