Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 427 Bytes

access-environment-variables-in-vba.md

File metadata and controls

17 lines (11 loc) · 427 Bytes

Access Environment Variable is VBA

Call the Environ function with the name of the environment variable.1

Environ("USERPROFILE")

Returns:

C:\Users\<username>

The environment variable can also be accessed by index number instead of by name.

Footnotes

  1. Microsoft Docs on the Environ function here