code to open a folder in vba

  • Thread starter Thread starter Sandeman
  • Start date Start date
S

Sandeman

Is it possible to open a folder with vba code? I want to open a folder named
"import" on the On_click event of a button. Can anybody help me?

Thanks in advance
 
Is it possible to open a folder with
vba code? I want to open a folder
named "import" on the On_click
event of a button. Can anybody
help me?

If you want to open Windows Explorer to a particular folder, I'm sorry I
don't have the answer, though I believe it is possible.

But, if you want to select a particular file, there is code for using the
Windows Common Dialog API directly that you can download from
http://www.mvps.org/access/api/api0001.htm.

Larry Linson
Microsoft Access MVP
 
Larry Linson said:
If you want to open Windows Explorer to a particular folder, I'm
sorry I don't have the answer, though I believe it is possible.

This came up recently. You can use Application.FollowHyperlink to open
a folder, given the path; e.g.,

Application.FollowHyperlink "C:\Temp"

or yu can use Shell to invoke explorer.exe; e.g.,

Shell "Explorer.exe ""C:\Temp""", vbNormalFocus
 
Back
Top