FileDialogSaveAs Questions

yeatmanj

Loose Cannon
Local time
Yesterday, 21:33
Joined
Oct 11, 2000
Messages
195
http://www.access-programmers.co.uk/forums/showthread.php?p=440522#post440522

I have read this thread as well as a number of other ones relating to exporting information with a SaveAs or in the above thread Directory Browser. The above thread is very helpful, but does not cover using a FileDialogSaveAs or same type API function.

My problem is that I need to be able to store the value that someone puts into a SaveAs dialog for later use. The Directory Browser only covers path not file name. I need the whole string Path & FileName.

Basically, I am developing a form that will allow a user to create a custom query. The user then needs to be able to export to excel, but I have been unable to create a SaveAs dialog that will work with the TransferSpreadsheet Method of the DoCmd property.

I am open to suggestions, but would really appreciate if they stuck with a SaveAs method to allow the user to customize location as well as file name.
 
I think you need to declare excel as an active document: for example

Code:
 Dim objXL As Excel.Application
Set objXL = GetObject(, "Excel.Application")
objXL.Save
 
Using my browser sample: I would allow the user to select the directory that they want to save the file to... then have them key a file name in a text box. Then combine that string together and use that string as the path\file name to export the query results using the transfer spreadsheet function. You will have to verify if the file already exists and delete it before you save the query output.
 
Good thinking. I should have figured that out, but I was a little bleary brained from looking at all the code around APIs.

Thanks Guys.
 

Users who are viewing this thread

Back
Top Bottom