LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default log of when files opened...


Hi all, i have used the following procedure to log when a specific file
has been opened, at present it sits in the ThisWorkbook object and
whenever the specific file is opened it writes the user, open date and
time and closed time and minutes open to a log.xls file.

BUT, i know want to roll this out across 40+ sheets, all of which can
be opened by selecting from a list and clicking to open.
I dont particularly want to have to copy this code into every workbook
in the directory, is there a way to set this running which will report
on the worksheet opened ??
Hope this explains things, if not let me know !
Thanks Amy xx
ps: vba below....:)

Private TimeOpen As Date

Private Sub Workbook_Open()
TimeOpen = Now
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim TimeClosed As Date
TimeClosed = Now
Open "s:\reportst\users\Log.xls" For Append As #1
Dim sPath As String
Print #1, ThisWorkbook.Path, Application.UserName, TimeOpen,
TimeClosed, Format((TimeOpen - TimeClosed), "hh:nn:ss")
Close #1

End Sub


--
AmyTaylor
------------------------------------------------------------------------
AmyTaylor's Profile: http://www.excelforum.com/member.php...o&userid=20970
View this thread: http://www.excelforum.com/showthread...hreadid=554879

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why two files opened? Lisa Excel Discussion (Misc queries) 4 September 29th 09 06:08 AM
log of when files opened... AmyTaylor[_63_] Excel Programming 0 June 23rd 06 08:35 AM
how to log all files opened on my pc? [email protected] Excel Discussion (Misc queries) 5 June 11th 06 11:09 PM
how to log all excel files opened on my pc? [email protected] Excel Programming 5 June 11th 06 07:53 PM
How do I get the files opened on the toolbar? Lisan Excel Discussion (Misc queries) 1 February 23rd 06 04:18 PM


All times are GMT +1. The time now is 10:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"