How can I set up a page tracker?

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I want a tracker for my excel workbook. The usernames I
need are the xp logons not the usernames seen as licenced
with office. I do not mind if there is a seperate file
held but I need to be able to restore any changes made
and know who made them. The sheets will be used by some
people which may not want the spreadsheet to work because
it is changing the way they have been doing things for
years as far as information collection.

Tom
 
I have worked it out I will share it with everyone.

It is the best possible solution and holds all info in a
dll file seperately. It gets the windows xp username and
not the application username too.

here goes --

paste this into thisworkbook

Private Sub Workbook_SheetChange(ByVal Sh As Object,
ByVal Target As Range)

If Target.Locked Then
TrackFile = "E:\Documents and Settings\All
Users\Desktop\Tracker.dll"
TargUser = UserName()
TargAddr = Sh.Name & "!" & Target.Address(False, False)
TargVal = Target.Resize(1, 1).Text
TargDate = Format(Now, "yyyy/mm/dd hh:mm")

x = TargDate & vbTab & TargUser & vbTab & TargAddr &
vbTab & TargVal
Open TrackFile For Append As #1
Print #1, x
Close #1

End If

End Sub

Then paste this into a new module -

Declare Function GetUserName Lib "advapi32.dll"
Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long

Function UserName() As String

Dim Buffer As String * 100
Dim BuffLen As Long

BuffLen = 100
GetUserName Buffer, BuffLen
UserName = Left(Buffer, BuffLen - 1)

End Function

You will now have a dll file in your choice of location
which can be opened in notepad.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top