jcosta_sr
asked on
Need Help with FileDialog Property in MS Acess VBA
Hi All,
I'm trying to use the File Dialog property to get input from a user to get the name and location to create a exported spreadsheet.
I can export the spreadsheet fine. Here is the problem.
Here is the code:
Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog( FileDialogType:=msoFileDia logSaveAs)
dlgSaveAs.Show
Here is the error - the Dim statement is where the error is happening
Compile: Error
User-Defined type not defined
Can anybody help?
Thanks in Advance
I'm trying to use the File Dialog property to get input from a user to get the name and location to create a exported spreadsheet.
I can export the spreadsheet fine. Here is the problem.
Here is the code:
Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog( FileDialogType:=msoFileDia
dlgSaveAs.Show
Here is the error - the Dim statement is where the error is happening
Compile: Error
User-Defined type not defined
Can anybody help?
Thanks in Advance
ASKER
when I subsitute object for FileDialog the first line passes but then the second line
Set dlgSaveAs = Application.FileDialog( FileDialogType:=msoFileDia logSaveAs)
fails
Named argument not found. (FileDialogType is highlighted)
Set dlgSaveAs = Application.FileDialog( FileDialogType:=msoFileDia
fails
Named argument not found. (FileDialogType is highlighted)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim dlgSaveAs As Object
That should do it.