Andresig Posted December 8, 2009 Posted December 8, 2009 I need to retrieve the user name of the computer, does somebody help me how to do this in VBA? Thank you, Quote
Andresig Posted December 8, 2009 Author Posted December 8, 2009 Hi Gile, LOGINNAME will help me, but is in LISP and I need to retrieve it in VBA Do you know how to retrieve it in VBA? Quote
Andresig Posted December 8, 2009 Author Posted December 8, 2009 Thanks Gile! I look the Variable "LOGINNAME" and now I know how to get the user name... Sub GetUserName() Dim UserName As String UserName = ThisDrawing.GetVariable("LOGINNAME") MsgBox UserName End Sub Quote
gile Posted December 8, 2009 Posted December 8, 2009 LOGINNAME isn't a LISP function, it's an AutoCAD system variable. I don't know much about VBA, but I think the equivalent of the (getvar "LOGINNAME") LISP expression should be something like : Application.GetVariable("LOGINNAME") Quote
bkm Posted December 9, 2009 Posted December 9, 2009 If you are after the computer name, you can get it by reading it's Windows environment variable as follows. Sub GetComputerName() Dim strComputer As String strComputer = Environ("COMPUTERNAME") MsgBox strComputer End Sub Quote
Andresig Posted December 9, 2009 Author Posted December 9, 2009 Thank you bkm, that will help me also. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.