Avatar of wlwestrom
wlwestrom
 asked on

How to copy a file from a storage device NOT drive letter through VBA

I am trying to copy a file from a storage device to a folder on my c:.  The devices comes up in Explorer like "Computer\Nexus 7\Internal storage" with no drive letter.  Also if I create a batch file to copy the file over from that location this particular file is hidden in DOS but i can see it in Explorer, R Click copy and paste fine.  

Ultimately I would like the user to be able to browse for the location and file and store the path but since it isnt a drive this isnt working.

Private Function BrowseforFile(szDialogTitle As String) As String
On Error GoTo BrowseforFile_Err

   With Application.FileDialog(3)   '4=msoFileDialogFolderPicker
   
        '.InitialFileName = Me.pastdirectory
        If .Show Then Debug.Print .SelectedItems(1)
       

        BrowseforFile = Nz(.SelectedItems(1), "Computer\Nexus 7\Internal storage")
       

    End With

BrowseforFile_RESUME:
    'BrowseforFile = .SelectedItems(1)
    Exit Function

BrowseforFile_Err_Exit:
   
    Exit Function

BrowseforFile_Err:
    Resume BrowseforFile_RESUME
End Function

I have tried all the various file dialog options to return location and/or file name.  Then i will need to be able to copy the file to a set location.

Any ideas?
Microsoft Access

Avatar of undefined
Last Comment
Jez Walters

8/22/2022 - Mon
Jez Walters

Apologies if this is obvious, but have you tried using a UNC path name, of the form \\<file server>\<file share>\<folder>\<file name> instead?
ASKER CERTIFIED SOLUTION
Jez Walters

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.
fblack61