?
Solved

How do I limit navigation options with VBA filedialog

Posted on 2010-11-24
6
Medium Priority
?
1,027 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 1336 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 1336 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 664 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 143

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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

801 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