View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default How to capture user ID in Excel macro?

Don't know about capturing it from the dialog box, but this returns the
login user id

environ("UserName")

--
HTH

Bob Phillips

"Ivan" wrote in message
...
Dear all,

I have an Excel macro program which uses ADO connection. It connects to

our
AS/400 database. When the program connects to the AS/400 system for the

first
time after the program is opened, it prompts a AS/400 login dialogue box

and
then the user keys in his/her user name and password. If I want to capture
the user name from the AS/400 login dialogue box, then how to do it? How

to
write the code in Excel macro? Is it possible?
Thanks in advance!

Ivan