Avatar of Bryce Bassett
Bryce Bassett
Flag for United States of America asked on

Can you prevent user from deleting a file when using msoFileDialogOpen?

In VBA macros, I frequently use
Application.FileDialog(msoFileDialogOpen)

Open in new window

to prompt the user to select a file from a specific folder.  

Is there a way to prevent them from deleting a file (accidentally or intentionally) while searching for one to open?

Thanks
Microsoft OfficeVBAMicrosoft Word

Avatar of undefined
Last Comment
Bryce Bassett

8/22/2022 - Mon
Bryce Bassett

ASKER
Piggybacking on my own question.  I also don't want the user to be able to navigate to any other folders.  Bottom line, I want to limit them to "read only" access to the folder I choose.

If the answer is I need to create my own dialog listing files in the target folder, rather than use the built in File Open dialog, I could do that.  But I prefer the simplest approach.

Thanks again.
strivoli

Did you consider setting the File System Permissions?
ASKER CERTIFIED SOLUTION
Fabrice Lambert

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
Bryce Bassett

ASKER
Thanks, I suspected the answer was no I don't have such control when using the standard dialog.  This is an enterprise-wise application, so it would not be possible for me to control permissions.  Thanks, both.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy