Solved

Monitoring file usage in a folder

Posted on 2004-08-31
5
118 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now