Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Monitoring file usage in a folder

Posted on 2004-08-31
5
Medium Priority
?
127 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 11

Assisted Solution

by:coopzz
coopzz earned 250 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 250 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

618 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