File Dialog object

T

Ton Kuipers

Dear all,

I use the following code in an Access program:

Public Function SavedFile() As String

Dim dlgSaveAs As FileDialog

Set dlgSaveAs = Application.FileDialog
(msoFileDialogSaveAs)

With dlgSaveAs
.Show
End With

End Function

My problem is that the constant "msoFileDialogSaveAs"
causes the following error:

Error 455, this action is not supported by the object.

The constant I use is a constant I select from the
constant list displayed by the Microsoft Visual Basic
Window. The other constants are working as expected.

Does anybody have a solution for this problem?

Thanks,

Ton
 
S

SA

Ton:

The reason this doesn't work, is that if you look at the Access File Menu in
the user interface, there is NO SaveAs option for general files, just for DB
objects. Your same code works fine in XL or Word etc. Access will never
support a standard File SaveAs as a result. You have to use the api calls
to pull up a file save as dialog. The code to do that has been posted for
years in many places, including the MS Knowledgebase and many web sites.
(e.g. www.mvps.org/vbnet)
 
S

SA

Ton:

The reason this doesn't work, is that if you look at the Access File Menu in
the user interface, there is NO SaveAs option for general files, just for DB
objects. Your same code works fine in XL or Word etc. Access will never
support a standard File SaveAs as a result. You have to use the api calls
to pull up a file save as dialog. The code to do that has been posted for
years in many places, including the MS Knowledgebase and many web sites.
(e.g. www.mvps.org/vbnet)
 
T

Ton Kuipers

Dear Steve,

Thank you for your response. What you told me about the
save as from Access i already know. And i realise that i
had to be more specific.

I do an export to a csv and want to use the save as option
in my program to support the user with saving this file to
a specific location wiht a specific name that the end user
prefers.

For that reason i do not save aan Access file but as .csv
file.

I hope you can help me with this, otherwise i wil use the
api code.

Thanks anyway,

Ton
 

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