How to open windows folder without using username via vba?

后端 未结 1 1579
挽巷
挽巷 2021-01-16 11:17

I am trying to open a windows folder (Downloads folder) via a commandbutton in a userform in Excel. However I want to use a generic folder path to access the downloads folde

相关标签:
1条回答
  • 2021-01-16 11:49

    You want to use the Environ() function:

    "C:\Users\" & Environ("Username") & "\Downloads"
    

    Environ Function

    0 讨论(0)
提交回复
热议问题