Error Message Trying to Use "Save As" Dialog

J

J. Trucking

Hello,

I have some vba which uses TransferSpreadhseet to export the results
of a query. Currently, it is set to save to the same directory as the
DB. However, I would like to change this and give the user the
ability to rename the file and save it to whatever directory they
choose. So I tried both of the following (not at the same time):

Application.GetSaveAsFileName
Application.Dialogs(xlDialogSaveAs).Show

I get the same error both times "Method or Data Member Not Found".
Has anyone ever had this happen before? My vba to export the sheet is
Option Explicit so I am assuming I am going to have to declare the
save as dialog somehow or revise my references. However, I'm not
exactly sure how to do that. Any suggestions?

Thanks in advance,

John
 
G

Graham R Seach

You need to set a reference to the Office library.

1. Open any code module.
2. From the Tools menu, select References.
3. Locate and select the Office x.x Object Library.
4. Click OK.

Then see the following web page for information about how to use the
FileDialog object:
http://msdn.microsoft.com/en-us/library/aa190811(office.10).aspx

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 

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