Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, _
nSize As Long) As Long
Sub Main()
Call API_Method
Call Env_Method
End Sub
Sub API_Method()
Dim lpBuff As String * 25
Dim ret As Long
Dim sUser As String
ret = GetUserName(lpBuff, 25)
sUser = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
sUser = UCase(sUser)
MsgBox sUser
End Sub
Sub Env_Method()
Dim sUser As String
sUser = UCase(Environ("username"))
MsgBox sUser
End Sub
ThisWorkbook.WriteReservedBy
ThisWorkbook.WriteReserved = True