Solved

Monitoring file usage in a folder

Posted on 2004-08-31
5
120 Views
Last Modified: 2010-05-02
Hi All.

I run a process which takes about 6 hours per week to run. This process generates 320 excel files, all placed in a certain folder each week. At the start of the following week this folder is cleared and the 320 new files are added.

As this is a tedious task, I sent an e-mail to determine who was using the files. 30 people have access to them but only 4 replied to say they use them. I suspect the number is higher, just that they couldn't be bothered to reply!

To avoid the embarrassment of sending another mail out, I would like to set up a counter that increases by 1 each time a file in that folder is opened. I could easily do this in each individual excel file and aggregate this figure - but there are 320 of them! So it wouldn't be worth my while. Also, I would like to see the user who accesses the files too as it could be the same one each time.

Any ideas?

Thanks for your time


0
Comment
Question by:ronanm1
  • 2
5 Comments
 
LVL 11

Assisted Solution

by:coopzz
coopzz earned 125 total points
ID: 11948114
If your files/folders is on a 2000/xp box you could always watch the open files on the computer management colsole.

TO get to it, it's under start | settings | control panel | Admin Tools | Computer Management  on an XP machine.
 then goto SystemTools | Shared Folders | Open Files

It doesn't to counting but you will see whats being shared at that moment (you have to keep refreshing regularly).

If you have vb.net this is quite an easy thing to implement. he's a link.
http://abstractvb.com/code.asp?A=1081
or
http://www.codeguru.com/vb/gen/vb_system/directoriesandfiles/article.php/c4827/
0
 
LVL 76

Accepted Solution

by:
David Lee earned 125 total points
ID: 11948169
Here's a link to a program that'll monitor a folder or multiple folders for changes.  You could modify the source code to implement the counter you described.

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=41816&lngWId=1
0
 

Author Comment

by:ronanm1
ID: 11963351
Hi,

Sorry for the delay in responding.
Coopzz - I don't have access to VB.Net. Also, I need to know the file usage, not the folder
BDF -  I am reasonably proficient at VB but not to the extent I can modify that code to get what I need.

Perhaps the best way is to bulk add a macro to the 320 workbooks? Is there an easy way to do this? I could then just agggregate the figures? I'd like to know who was accessing them too though :( Any ideas??
0
 

Author Comment

by:ronanm1
ID: 11985807
This works just fine

Dim WkbkName As Object
      Workbooks.Open Filename:="C:\Documents and Settings\DDG\My Documents\Row+1.xls"
        Workbooks.Open Filename:="C:\Documents and Settings\DDG\My Documents\Row+2.xls"
         Workbooks.Open Filename:="C:\Documents and Settings\DDG\My Documents\Row+3.xls"
       
    Sheets.Add
    Sheets("Sheet4").Name = "Log"
    Range("A1").Select
    Cells(1, 1) = "Hen"
    Cells(2, 1) = "Len"
    Sheets("Log").Select
    ActiveWindow.SelectedSheets.Visible = False
    ActiveWorkbook.Save
    Workbooks.Close
    Sheets("Sheet2").Select
    Cells(1, 1) = "='[Row+3.xls]Sheet2'!Cells(1,1)+'[Row+2.xls]Sheet2'!cELLS(1,1)"
   

          For Each WkbkName In Application.Workbooks()
              If WkbkName.Name <> ThisWorkbook.Name Then WkbkName.Close
          Next

       End Sub

Basically add a hidden sheet ("Log") to each listed workbook, and aggregate these in an active workbook on sheet 2.

Thanks.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question