how to find a path of a file?

how to find a path of a file?

Anonymous
Not applicable
634 Views
3 Replies
Message 1 of 4

how to find a path of a file?

Anonymous
Not applicable

In the USERFORM of vba in acad, I have a button to  find a file path by choosing it through the window, here is my codes, and it said, Object does't support this property or method. I have load the reference of Microsoft office library, and I can't find the reference of msofiledialog. Can you help me with this? 

Dim fd As FileDialog
    Set fd = Application.FileDialog(msoFileDialogFilePicker)
    Dim vrtSelectedItem As Variant
    With fd
        .AllowMultiSelect = True
        If .show = -1 Then
            For Each vrtSelectedItem In .SelectedItems
                MsgBox "Selected item's path: " & vrtSelectedItem
            Next
        Else
        End If
    End With
    Set fd = Nothing
0 Likes
635 Views
3 Replies
Replies (3)
Message 2 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> I have load the reference of Microsoft office library

This is a 32bit library, so in case you are running 64bit AutoCAD (>=2013 or >=2014, not sure at the moment) you'll have to search for a 64bit alternative (or search in Google for msoFileDialogFilePicker 64bit

 

Good luck, - alfred -

 

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 4

Anonymous
Not applicable

Dear Alfred,

 

Sorry to reply late...

 

I am using the 2016 edition. Do you mean I need to download the msoFileDialogFilePicker 64bit? But I didn't find this file in Google or in our community. Do you have other solutions?

 

thanks.

0 Likes
Message 4 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Do you mean I need to download the msoFileDialogFilePicker 64bit?

I meant you will need to find an alternative to that.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes