Solved

How do I limit navigation options with VBA filedialog

Posted on 2010-11-24
6
964 Views
Last Modified: 2012-05-10
I am trying to limit the navigation abilities of FileDialog(msoFileDialogFolderPicker).  I am setting the initialfilename to the folder I wish to start from.   I want to allow navigation to any subfolder within the initial file name, but prevent from navigating higher.   Below is a snipit of my code,  How can I restrict my navigation capabilities?  

Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFolderPicker)
fd.InitialFileName = "C:\WINDOWS\system32"
fd.Show
0
Comment
Question by:DavidWoods57017
6 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 334 total points
ID: 34212504
there's no built in mechanism in common dialog controls to restrict specific folder.
With the common dialog, you can browse any folder on any drive to which your login account has access and/or permissions.
what you can do is customize your own file dialog control which implements folder restrictions.



0
 

Author Comment

by:DavidWoods57017
ID: 34212918
sedqwick stated: what you can do is customize your own file dialog control which implements folder restrictions.  Can someone provide an example of customizing a a file dialog control?
0
 
LVL 42

Assisted Solution

by:sedgwick
sedgwick earned 334 total points
ID: 34212945
check this post for custom dialogs tutorial:
http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=15
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 166 total points
ID: 34214635
...Now making a custom "File Dialog" box will be even trickier...

You will somehow set a "Top" folder.

But the key lies in sedqwick's  first post:
"With the common dialog, you can browse any folder on any drive to which your login account has access and/or permissions."
So if you could restrict the users Login Access to all but your Top level folder, you may have a shot here...

What would the worse case be if a user browsed above a certain folder?

JeffCoachman
   
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34959151
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now