Writing Data to an External File
Souny
The first part of the procedure to capture the user name is thus.
Place this code in a normal module.
Option Explicit
Function UserNameOffice() As String
UserNameOffice = Application.UserName
End Function
In the Workbook module place the following code.
Option Explicit
Private Sub Workbook_Open()
Worksheets("Sheet1").Cells(1, 1).Value = "=UserNameOffice()"
Worksheets("Sheet1").Cells(1, 2).Value = Date & Time
End Sub
Upon open it will place the user name and date and time in A1 and B1
respectively.
Take care
Marcus
|