ozzyb77
02-17-2012, 08:07 AM
I have the below AVB script to pull through user names from Windows into a particular column (column C). This works fine for when I open the document however when I opened the document from a colleagues PC it changed my entry (user name) to his name. Ideally what i want is anything I enter to be saved and then when a colleague opens the document to enter data it doesn't change the information i have enetered and allows him to record his data.
Is there something missing from the script below?
Select Case UCase(NameType)
Case Is = "OFFICE", "1"
GetName = Application.uSERNAME
Exit Function
Case Is = "WINDOWS", "2"
GetName = Environ("UserName")
.Save
Exit Function
Case Else
GetName = CVErr(xlErrValue)
.Save
End Select
End Function
Thanks
Ozzy
Is there something missing from the script below?
Select Case UCase(NameType)
Case Is = "OFFICE", "1"
GetName = Application.uSERNAME
Exit Function
Case Is = "WINDOWS", "2"
GetName = Environ("UserName")
.Save
Exit Function
Case Else
GetName = CVErr(xlErrValue)
.Save
End Select
End Function
Thanks
Ozzy