Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Excel and events

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   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default Excel and events

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
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
Excel API events Dev Excel Programming 9 May 24th 06 03:11 AM
do events? background events cereldine[_15_] Excel Programming 1 April 12th 06 01:06 PM
Excel events - please help!!!! j23 Excel Programming 1 April 7th 04 01:49 PM
Trap Excel events from VB pat Excel Programming 0 August 18th 03 11:01 PM
logging excel events? John Wilson Excel Programming 0 July 13th 03 02:26 AM


All times are GMT +1. The time now is 10:19 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"