On Tue, 03 Jan 2006 05:42:55 GMT, jim Bob wrote:
Hi,
I'm using the transferspreadsheet function to export my tables into
excel. Is it possible to export just certain columns? and is it possible
to export it without harding coding the file name and location?
Thanks in advance.
*** Sent via Developersdex http://www.developersdex.com ***
Create a query with just the fields you wish to export. Export that
query.
You'll have to set the path and file name at some point.
If you want to leave it up to the user, you can use this simplest of
methods.
Dim strWhere as String
strWhere = InputBox("Enter path and file name")
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
"QueryName", strWhere
The user will be prompted for the path and file name.
Add whatever error handling you need to verify that the path and file
name are properly entered, as well as to exit the sub if the input box
is canceled.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail