borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (HELP!!!!)Next Topic (MS Project data access) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : FileDialog Property doesn't work
Poster Message
JPL
Level: Protégé

Registered: 27-01-2005
Posts: 8

icon FileDialog Property doesn't work

I want to use VB in Access to open a text file, so I started with following routine (based on MS VB help):

Private Sub read_file_Click()

Dim a As FileDialog

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

End Sub


However, when I try to use this I get a Compile error: "User defined type not defined"  on the Dim statement.

How is that possible?
'FileDialog' should be a standard type, is it?
Or do I have to include a special Reference for this type?

Thanks!!
JP

16-09-2005 at 07:20 AM
View Profile Send Email to User Show All Posts | Quote Reply
bemej
Level: Trainee

Registered: 23-09-2005
Posts: 1
icon Re: FileDialog Property doesn't work

In regards to the FileDialog error you must include Microsoft Office 10.0 Object Library in your references.

Just in case

While in VBA choose Tools then References

Good Luck

23-09-2005 at 02:20 PM
View Profile Send Email to User Show All Posts | Quote Reply
JPL
Level: Protégé

Registered: 27-01-2005
Posts: 8
icon Re: FileDialog Property doesn't work

Yes, that's it!!

Thanks for that.

(Still amazing Bill's hackers don't put a simple reference in their help-files to indicate with Library is required for a command).

cheers,
JP

30-09-2005 at 02:48 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : FileDialog Property doesn't work
Previous Topic (HELP!!!!)Next Topic (MS Project data access) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder