filedialog compile err..using lib 11..

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i'm still getting compile error on dim stmt below, even after setting
reference to MS Lib 11..any ideas? (access 2003)

Dim dlgOpen As FileDialog

Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)

With dlgOpen
.AllowMultiSelect = True
.Show
End With
 
Go with Douglas' solution. I have had the API version running nicely for a
fair while. Recently I thought the FileDialog would be a neater solution as
it also included a folder browse - it was a nice solution BUT, the problem
with references was an utter pain. I have returned to the API call. If you
have Access Developer solutions for both the FileDialog and the Folder Browse
are in the Code Librarian or use Douglas' hLink
Terry
 
nycdon said:
i'm still getting compile error on dim stmt below, even after setting
reference to MS Lib 11..any ideas? (access 2003)

Dim dlgOpen As FileDialog

*Which* "MS Lib 11"? "Microsoft Office 11.0 Object Library" would be
what you need; a reference to "Microsoft *Access* 11.0 Object Library"
(emphasis mine) isn't enough. But I agree with Doug Steele and
others -- calling the API directly is really the way to go.
 
Dirk Goldgar said:
*Which* "MS Lib 11"? "Microsoft Office 11.0 Object Library" would be
what you need; a reference to "Microsoft *Access* 11.0 Object
Library" (emphasis mine) isn't enough. But I agree with Doug Steele
and
others -- calling the API directly is really the way to go.

I just saw from a separate message of yours that you *are* referencing
the Office library. So I don't know why you would be getting an error
on the Dim statement. When I test this in Access 2002, though, I get an
error on the line
Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)

because the example in the help file is just plain wrong, and the
argument should be specified as:

Set dlgOpen = Application.FileDialog( _
DialogType:=msoFileDialogOpen)

or even just

Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
 
Back
Top