Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to write to an event log named 'Trackers' that records a users
name and machine everytime a specific execl workbook is updated, can this be done? How do I go about making the event log? Thanks -lumpjaw |
#2
![]()
Posted to microsoft.public.excel,microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
You would need to enter something like the following in a Workbook event before save. This will open a file called Tracker.txt in the same folder as the workbook, and add a row with the relevant details for you. This must be pasted into the ThisWorkbook module, NOT in a standard module. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Open ThisWorkbook.Path & "\Trackers.txt" For Append As #1 Print #1, Environ("USERNAME") & "," &Environ("COMPUTERNAME") & "," & Now Close #1 End Sub You can copy the code and paste it into your Visual Basic Editor To do this, Alt + F11 (open VBE) Ctrl + R (open Project Explorer) Select the file name on the left Select This WorkBook Paste code in Module For more help on inserting macros David McRitchie has lots of useful help on his site at http://www.mvps.org/dmcritchie/excel/install.htm http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Regards Roger Govier "Lumpjaw" wrote in message ... I would like to write to an event log named 'Trackers' that records a users name and machine everytime a specific execl workbook is updated, can this be done? How do I go about making the event log? Thanks -lumpjaw |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel API events | Excel Programming | |||
do events? background events | Excel Programming | |||
Excel events - please help!!!! | Excel Programming | |||
Trap Excel events from VB | Excel Programming | |||
logging excel events? | Excel Programming |