File picker wont let go... (1 Viewer)

NauticalGent

Ignore List Poster Boy
Local time
Today, 17:19
Joined
Apr 27, 2015
Messages
6,367
Good morning everyone, I'm having an issue with the msoFileDialogFilePicker that I have not seen anyone ask about...

It works as advertised but when I try to copy the file form its original location to another location, I got runtime error 70 - Permission denied. While reading up on the msoFileDialog family, there was a footnote about if the file is open, the Permission Denied error is what you get.

I am using the FileCopy method to attempt this and I have tried setting the FileDialog object to nothing before the FileCopy and I have even tried passing the SelectedItems(1) (strFilePath = .SelectedItems(1)) to another Sub in hopes that it would somehow "let go"...nothing has worked.

Is there something I am missing or is the nature of the beast? If so, what is the work-around?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:19
Joined
Oct 29, 2018
Messages
21,494
Hi. I believe there is a bug right now when using the FileDialog object. The folder gets locked up until Access is closed. Are you using the latest version of Access?

PS. On second thought, it may be a bug in Office, since the FileDialog is a common object to the entire Office suite.
 
Last edited:

NauticalGent

Ignore List Poster Boy
Local time
Today, 17:19
Joined
Apr 27, 2015
Messages
6,367
Hi. I believe there is a bug right now when using the FileDialog object. The folder gets locked up until Access is closed. Are you using the latest version of Access?

PS. On second thought, it may be a bug in Office, since the FileDialog is a common object to the entire Office suite.
Thanks DBG, I did notice that once I closed Access, there was a "reset" of sorts. Guess I'll have to wait it out...
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:19
Joined
Oct 29, 2018
Messages
21,494
Okay, here's a possible workaround. Try using ChDir to change the current directory to a different folder.
 
Solution

theDBguy

I’m here to help
Staff member
Local time
Today, 14:19
Joined
Oct 29, 2018
Messages
21,494
There are two types of cool in this world: DBG Cool and those that SHOULD be DBG cool...worked like a charm, you sir, are the shiznit.
Glad to hear you got it to work. I can't take all the credit. I just passed along the information from those who know more than I do. Cheers to them and you!
 

Users who are viewing this thread

Top Bottom