Link to home
Start Free TrialLog in
Avatar of Bryce Bassett
Bryce BassettFlag 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
Avatar of Bryce Bassett
Bryce Bassett
Flag of United States of America image

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.
Avatar of strivoli
Did you consider setting the File System Permissions?
ASKER CERTIFIED SOLUTION
Avatar of Fabrice Lambert
Fabrice Lambert
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.