By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

Choose locations of exported spreadsheets

P: 23
How do you choose what folder you want a transferspreadsheet command to extract into? Can I specifiy a different places for each, right now everything is going into My Documents.
Nov 28 '06 #1
Share this Question
Share on Google+
2 Replies

P: 143
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "YourTableOrQueryName", "PathToWhere.xls", True
Nov 28 '06 #2

Expert Mod 15k+
P: 31,661
See if the following gives you whart you need.
TransferSpreadsheet Method

The TransferSpreadsheet method carries out the TransferSpreadsheet action in Visual Basic. For more information on how the action and its arguments work, see the action topic.


DoCmd.TransferSpreadsheet [transfertype][, spreadsheettype], tablename, filename[, hasfieldnames][, range]

The TransferSpreadsheet method has the following arguments.

Argument Description
transfertype One of the following intrinsic constants:
acImport (default)
If you leave this argument blank, the default constant (acImport) is assumed.
spreadsheettype One of the following intrinsic constants, or equivalent numeric settings:
0 acSpreadsheetTypeExcel3 (default)
6 acSpreadsheetTypeExcel4
5 acSpreadsheetTypeExcel5
5 acSpreadsheetTypeExcel7
8 acSpreadsheetTypeExcel8
8 acSpreadsheetTypeExcel9
2 acSpreadsheetTypeLotusWK1
3 acSpreadsheetTypeLotusWK3
7 acSpreadsheetTypeLotusWK4
4 acSpreadsheetTypeLotusWJ2 Japanese version only
Note You can link to data in a Lotus 1-2-3 spreadsheet file, but this data is read-only in Microsoft Access. You can import from and link (read-only) to Lotus .WK4 files, but you can't export Microsoft Access data to this spreadsheet format. Microsoft Access also no longer supports importing, exporting, or linking data from Lotus .WKS or Microsoft Excel version 2.0 spreadsheets by using this method.
If you leave this argument blank, the default constant (acSpreadsheetTypeExcel8) is assumed.
tablename A string expression that's the name of the Microsoft Access table you want to import spreadsheet data into, export spreadsheet data from, or link spreadsheet data to, or the Microsoft Access select query whose results you want to export to a spreadsheet.
filename A string expression that's the file name and path of the spreadsheet you want to import from, export to, or link to.
hasfieldnames Use True (1) to use the first row of the spreadsheet as field names when importing or linking. Use False (0) to treat the first row of the spreadsheet as normal data. If you leave this argument blank, the default (False) is assumed.
When you export Microsoft Access table or select query data to a spreadsheet, the field names are inserted into the first row of the spreadsheet no matter what you enter for this argument.
range A string expression that's a valid range of cells or the name of a range in the spreadsheet. This argument applies only to importing. Leave this argument blank to import the entire spreadsheet.
When you export to a spreadsheet, you must leave this argument blank. If you enter a range, the export will fail.
Nov 28 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.