Microsoft Office 10.0 Object libary reference not working??

R

Rene Muench

Hi there,

I am running AccessXp and want to make use to the new filedialog object.
the references are set to: VBA, MS Access 10.0 Object Library, Ole
Automation, Microsoft Office 10.0 Object library,
Ms Dao 2.5/3.5 compatible library.

Public Function GetXXXfilePath() as String

Dim objDlg as Office.Filedialog
Const Open_button = -1

Set objDlg = Application.Filedialog( _
FileDialogType:=msoFileDialogOpen)

'Now access complains that it can't find the named Argument "FileDialog"
(Error448)!!!???
' what am I missing or could I do differently???
'........and further more
End Function

Kind regards
Norman
 
D

Douglas J. Steele

Well, first of all, I don't believe the DAO 2.5/3.5 Compatibility Library is
appropriate for use with Access XP. Replace it with DAO 3.6, and see whether
that solves the problem.

Next, you've declared objDlg as Office.Filedialog, yet you're trying to set
it to Application.Filedialog. One of the two is wrong (and I'm afraid I
don't know which, because I always call the API directly) To learn how to
call the APIs, see the example Ken Getz provided in
http://www.mvps.org/access/api/api0001.htm at "The Access Web"
 

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

Top