querying environment variables from vba

D

dcurren

Hello All,
Can someone please tell me if it's possible to query an
environment variable for use in a macro? If I have a cmd
prompt open and type set, I get list of all the env.
variables. I see the environment variable
called "UserName" is set to BBJohnson and it would be such
a huge improvement to my macro if I could get that
information from that variable.
 
D

dcurren

Thanks a lot - that worked with just a little modification.
I would never have figured that out on my own. I even
looked around on the mvps site but did not use the proper
search terms.

Although this works fine for the present macro, it would
probably come in handy later - is there a way to query the
environment variables?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top