I am trying to call the windows NT login/username on a cell using the VB script below.
Function UserNameWindows() As String
UserNameWindows = Environ("USERNAME")
End Function
However, if I am to call it on the cell as:
=UserNameWindows()
I get
<TABLE style="WIDTH: 54pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=72 border=0><COLGROUP><COL style="WIDTH: 54pt" width=72><TBODY><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 54pt; BORDER-BOTTOM: #f0f0f0; HEIGHT: 15.75pt; BACKGROUND-COLOR: transparent" align=middle width=72 height=21>#NAME?</TD></TR></TBODY></TABLE>
as the answer.
Can anyone assist, please. Thanks!
Function UserNameWindows() As String
UserNameWindows = Environ("USERNAME")
End Function
However, if I am to call it on the cell as:
=UserNameWindows()
I get
<TABLE style="WIDTH: 54pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=72 border=0><COLGROUP><COL style="WIDTH: 54pt" width=72><TBODY><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 54pt; BORDER-BOTTOM: #f0f0f0; HEIGHT: 15.75pt; BACKGROUND-COLOR: transparent" align=middle width=72 height=21>#NAME?</TD></TR></TBODY></TABLE>
as the answer.
Can anyone assist, please. Thanks!