Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3879148
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:41:35+00:00 2026-05-19T22:41:35+00:00

i saw this topic How to show "Open File" Dialog in Access 2007 VBA?

  • 0

i saw this topic How to show "Open File" Dialog in Access 2007 VBA? and i like the solution there that’s not using references, however, i can’t figure out how to display the file path that the user selected. can someone please explain

thank you very much

this is the piece i’m talking about

Dim f As Object   
Set f = Application.FileDialog(3)   
f.AllowMultiSelect = True   
f.Show    
MsgBox "file choosen = " & f.SelectedItems.Count
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:41:36+00:00Added an answer on May 19, 2026 at 10:41 pm

    First things first: you should always prefer to use strongly-typed variables whenever possible. In this case, you can replace Object with Office.FileDialog.

    To display the paths of each file that was selected, you need to loop through the SelectedItems collection. For example, you would add the following code:

    Dim f As Office.FileDialog
    Set f = Application.FileDialog(3)   
    f.AllowMultiSelect = True
    
    ' Show the dialog. If the method returns True, the user picked at least one file.
    ' If the method returns False, the user clicked Cancel.
    If f.Show Then
        MsgBox f.SelectedItems.Count & " file(s) were chosen."
    
        ' Display the full path to each file that was selected
        Dim i As Integer
        For i = 1 To f.SelectedItems.Count
            MsgBox f.SelectedItems(i)
        Next i
    End If
    

    Note that the FileDialog also has other properties that you can set, if you require customization. For example, the .Title property allows you to specify a title that will appear as the dialog’s caption in the title bar. You can also specify a filter using the .Filter property, which will limit the type of files that the user will be able to see and choose from in the dialog. For example, if you wanted to limit the choices to only Access Databases, you could add the following code:

    ' Clear out the current filters
    f.Filters.Clear
    
    ' Add a few custom filters
    f.Filters.Add "Access Databases", "*.mdb"
    f.Filters.Add "All Files", "*.*"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saw this topic and implement IntentService as describes, but what if I want
I just saw this topic: Datatable vs Dataset but it didn't solve my doubt
I saw this same question for VIM and it has been something that I
I saw this question asked about C# I would like an answer for PHP.
I saw some topics about this, but the problem is that the solutions required
I saw two related questions about this topic - one has an old link
I saw some other similar questions on this topic here but they were not
this is quite frustrating, I saw many questions around this topic, but strangely enough
This has probably been discussed however all the threads I saw on this topic
I saw a lot of question on this topic and it took me some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.