File Picker Dialog

G

Guest

It appears that the command "Application.FileDialog" is not available under
the "Microsoft Access 9.0 Object Library" nor the "Microsoft Office 11.0
Object Library." Is there something that I am missing or is there another
way of calling the FileDialog?

I have a database that I need to routinely import Excel spreadsheets into
that are created from another source by the user, who will name the Excel
file. I wish to have a button the user can click that will automate much of
the "Import" process.
 
G

Guest

My mistake. The code you suggested is the code I actually had. The code I
posted was a test that I ran but didn't work either.

This is the following code:
-------------------------------------
Dim strFileName As String
Dim result As Integer
Dim dlgFilePicker As Application
Dim strQueryName As String
Dim fd As FileDialog

Set fd = Application.FileDialog(msoFileDialogFolderPicker)

With fd
.Title = "Select File To Import"
.Filters.Add "Excel", ".xls"
.FilterIndex = 1
.AllowMultiSelect = False
.InitialFileName = CurrentProject.Path
result = .Show
If (result <> 0) Then
strFileName = Trim(.SelectedItems.Item(1))
End If
End With
-------------------------------------


When the code is run I get a "Method or datamember not found" highlighting
the ".FileDialog"

There must be something wrong with my data library!
 
G

Guest

I'm having the same problem. BeWyched wrote...

My system has the Office11 .dll situated at:

c:\program files\common files\microsoft shared\office11\mso.dll - size
11,969KB created 7/9/06

I have an Office11 folder where you referenced, but there was NOT an mso.dll
there. I saw three other DLLs, but not that one. Any additional suggestions?

Thanks!
 
G

Guest

More info re: my problem. I'm running Office 2007. The code I'm using to
(try to) open a file was copied from VB code in an Excel application (which I
wrote using Office 2003). When it didn't work in Access 2007, I tried it in
Excel 2007 and it worked!!! I had Access and Excel open at the same time,
with the VB modules open at the same time, and checked the "About Microsoft
Visual Basic"... it's the SAME version in both.

So why does it work in Excel and not in Access? It's the same code, copied
with NO modifications whatsoever.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

File Dialog Picker 1
Show file dialog box 1
Access 2000 - FIle Open Dialogue 4
a compile error 6
File Dialog Box Problem 3
File Dialog 6
FileDialog Widget 2
Terminate main procedure from a subroutine? 4

Top