How do I export a datasheet back to an Excel table

Source: Internet
Author: User
Tags query
excel| Backup | data
How do I export a datasheet back to an Excel table
Author: cg1 Excerpt from: access911.net
Problem:

How do I export a datasheet back to an Excel table
Reply:
Note: You can not only export the data from the table to Excel files, but also export the results of the query to Excel files.
For example, paste the following statement into NORTHWIND. In the MDB module, you can export the results of the "aggregate sales by Year" query to C:\A.XLS in this EXCEL file.
The reason for this is to demonstrate an export query rather than an export table because the query can be the result of a table filtered by some criteria.
Function Exporteg ()
Docmd.transferspreadsheet Acexport, AcSpreadsheetTypeExcel9, "Summary of sales by year", "C:\a.xls", True
End Function



Take a look at the following example:
Docmd.transferspreadsheet Acexport, AcSpreadsheetTypeExcel9, "Table_juan", strFilePath, True, "Juan"


strFilePath is the path to XLS file, such as: Strfilepath= "C:\a.xls"

Table_juan is the name of the table in the database
Juan is the name of sheet in the XLS file.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.