Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
File and Path Pickers for Visio 2013
Tried to set-up a file picker to import images
It hangs up on Set fd = Application.FileDialog(mso
) - error message says object not recognized?
I think the issue may be a missing reference but I'm not sure which one
Can anybody help?
'Declare a variable as a FileDialog object.
Dim fd As FileDialog
'Create a FileDialog object as a File Picker dialog box.
Set fd = Application.FileDialog(mso
'Declare a variable to contain the path
'of each selected item. Even though the path is aString,
'the variable must be a Variant because For Each...Next
'routines only work with Variants and Objects.
Dim vrtSelectedItem As Variant
'Use a With...End With block to reference the FileDialog object.
'Use the Show method to display the File Picker dialog box and return the user's action.
'The user pressed the button.
If .Show = -1 Then
'Step through each string in the FileDialogSelectedItems collection.
For Each vrtSelectedItem In .SelectedItems
'vrtSelectedItem is a string that contains the path of each selected item.
'You can use any file I/O functions that you want to work with this path.
'This example displays the path in a message box.
MsgBox "The path is: " & vrtSelectedItem
'The user pressed Cancel.
'Set the object variable to nothing.
Set fd = Nothing
8/22/2022 - Mon
I use both the Microsoft Scripting Library and the Microsoft Office xx (your version) Library in most of my apps. I think the Scripting library is what you need for FSO.
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
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.
See how we're fighting big data
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
Worked Perfect with one slight change - msoFileDialogFolderPicker picks a folder
Thanks for catching my mistake on msoFileDialogFilePicker vs msoFileDialogFolderPicker.
I've forwarded the issue to the responsible party at Microsoft, and hope that the on-line help gets fixed.
Your help has saved me hundreds of hours of internet surfing.
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent