File And Folder Picker Dialog in VBA | Excel VBA Tutorial in Hindi
For online classes, please contact us at 93100 73387
File Picker Allows User to select one file or Multiple File And Folder Picker allows user to select one or more folders. By Using the SelectedItems collection of FileDialog Object, we can get the selected File/Folder path.
🔴 Subscribe for more videos just like this: bit.ly/2PUQwXk
🎧In this video, you will learn
►How to use File Picker in VBA
►How to Folder Picker in VBA
►How to get a single file path selected by a user using File Picker in VBA
►How to get multiple files path selected by a user using File Picker in VBA
►How to get the count of selected folders/files by a user using File/Folder Picker Dialog
Download Excel Macro File For Practice 👉 github.com/Aut...
➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖
🖥️Video Summary 👉
We already discussed Open Dialog Box and Save As Dialog Box in our previous videos. In this video, you will learn how to use File and Folder Picker.
If you want to display File Picker, the steps will be exactly the same as what you follow in File Open Dialog Box or Save As Dialog Box. You need to declare a variable of FileDialog Type. This variable will store the reference/instance of File Picker. And then you need to use the Show Method of FileDialog Object to display File Picker.
Dim flDialog As FileDialog
Set flDialog = Application.FileDialog(msoFileDialogFilePicker)
flDialog.Show
Till now, it's pretty simple. Now we need to get the path of the file selected by the User using File Picker. We will use the SelectedItems collection of FileDialog Object to get the file path. Let's try to display the file path in a message box.
MsgBox flDialog.SelectedItems(1)
We are getting the path of one selected File in File Picker Dialog. Suppose we need to get a file path of more than files selected by users using File Picker Dialog. We will use a loop for getting all files path from the SelectedItems collection.
Sub FilePickerDemo()
Dim flDialog As FileDialog
Dim indx As Integer
Set flDialog = Application.FileDialog(msoFileDialogFolderPicker)
If (flDialog.Show) Then
For indx = 1 To flDialog.SelectedItems.Count
MsgBox flDialog.SelectedItems(indx)
Next
Else
MsgBox "You clicked on cancel button"
End If
End Sub
File Picker Dialog is used to get the selected file path. However, if you need to provide a facility to select a folder. Then you need to use Folder Picker Dialog. You need to use the below code for displaying Folder Picker Dialog👉
Dim flDialog As FileDialog
Set flDialog = Application.FileDialog(msoFileDialogFolderPicker)
flDialog.Show
➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖
Hope you found this video useful. Please like, share, and subscribe to our channel. This will motivate us to create more good content. Thanks!
🎬Watch our most recent videos: / automationfever
💜You Might be Interested in (Free Tutorials):
Basic VBA Tutorials (Hindi)👉 • Why Should Learn VBA |...
Advanced VBA Tutorials (Hindi)👉 • Send Outlook Mail in V...
Excel VBA Projects (Hindi) 👉 • Add & Change Sheet Tab...
VBA Outlook Automation (Hindi)👉 • Send Outlook Mail in V...
Excel Tips & Tricks (Hindi)👉 • Copy From Clipboard - ...
➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖
🎧Do watch our Other VBA Videos (Hindi) 👉
Find Method in VBA 👉 • Find Method in VBA | E...
Handling Failed Find & Case Sensitive Searches - Find Method 👉 • Handling Failed Find &...
Search All Matches - Find Method 👉 • Search All Matches - F...
Find the Last Match - Find Method 👉 • Find Last Match - Find...
Find Date Using Find Method 👉 • Find Date Using Find M...
Using LookIn in Find Method 👉 • Using LookIn in Find M...
Using Search Format in Find Method 👉 • Using Search Format in...
Find With Wildcards 👉 • Find With Wildcards | ...
Search String In All Sheets - Find Method 👉 • Search String In All S...
➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖〰➖
-------------------------------SOCIAL-------------------------------
🛠️ If you have any doubt or query, drop us an email: query@automationfever.com
🌎Website: www.automationf...
👥Facebook: / feverautomation
🐦Twitter: / automationfever
📸Instagram: / automationfever
📕Blogger: automationfeve...
#filepickerdialog #folderpickerdialog #filedialog #excelvba #vba #excelmacros #automationfever
Негізгі бет File And Folder Picker Dialog in VBA | Excel VBA Tutorial in Hindi
Пікірлер: 9