Open a folder with Code

Leesha
BronzeLounger
Posts: 1484
Joined: 05 Feb 2010, 22:25

Open a folder with Code

Post by Leesha »

Hi,
I need to give users a the ability to easily find the folder where their backend tables are stored so they can copy them to back them up. I was using a hyperlink on a button but it doesn't work consistently. Is there a way to open a folder using code instead of a hyperlink?
Thanks,
Leesha

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Open a folder with Code

Post by HansV »

Try

Code: Select all

    Dim strFolder As String
    strFolder = "..." ' folder path
    Shell "Explorer """ & strFolder & """", vbNormalFocus
Best wishes,
Hans

Leesha
BronzeLounger
Posts: 1484
Joined: 05 Feb 2010, 22:25

Re: Open a folder with Code

Post by Leesha »

Thanks Hans! That worked perfectly!