How to get the current user

Started by davidgon, February 13, 2017, 10:41:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

davidgon

Well, I want to get the current user of the computer by code. I thought it was going to be easy, but using CurrentUser, I get Admin, not my real username. Any idea?

Thanks!

Surrogate

#1
try this
Quote from: egoist in post #769fGetUserName = VBA.Environ("UserName")
or this way
Quote from: Alex_ST in post #1399CreateObject("Wscript.Network").UserName

wapperdude

Similar to what Surrogate provided, see this forum post, scroll to bottom:  http://visguy.com/vgforum/index.php?topic=5375.0

Wapperdude
Visio 2019 Pro

davidgon