Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why two files opened? | Excel Discussion (Misc queries) | |||
log of when files opened... | Excel Programming | |||
how to log all files opened on my pc? | Excel Discussion (Misc queries) | |||
how to log all excel files opened on my pc? | Excel Programming | |||
How do I get the files opened on the toolbar? | Excel Discussion (Misc queries) |