Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filters - File Dialog (2004)

    Hi there,

    I am having some difficulty developing an input routine for a database I am developing.

    I would like the user to select their file [I am using FileDialog(msoFileDialogOpen)] and either restrict their choice to a .xls or .csv file or return a msg box telling them they cannot enter a file not of this type.

    Any help would be much appreciated.

    Thanks,
    Nick.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filters - File Dialog (2004)

    Try something like this:

    With Application.FileDialog(msoFileDialogOpen)
    .Filters.Clear
    .Filters.Add "Excel files", "*.xls;*.csv"
    If .Show = True Then
    MsgBox .SelectedItems(1)
    End If
    End With

    Replace the MsgBox line with the code you want to execute if the user selected a file.

  3. #3
    New Lounger
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filters - File Dialog (2004)

    Thanks very much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •