ExportAccessToExcelAsPivotTable.mdb |
Post Reply |
Author | |
A.D. Tejpal
Microsoft MVP Joined: 30 Jun 2008 Status: Offline Points: 192 |
Post Options
Thanks(0)
Posted: 09 Jul 2008 at 10:49pm |
This sample db demonstrates export of access queries to excel. If desired, pivot tables based upon exported data, also get created in the destination file (The destination files are stored in a folder named ExportedExcelFiles, located within the parent folder containing the sample db). Queries meant for export are displayed in multi-select list box. If multiple selection is made, bulk export takes place, data from each selected query going to a separate sheet in destination workbook. For queries where pivot table view is also required at excel end, names of pivot fields (row field, column field, data field) appear in appropriate columns in the list box. For other queries (not requiring pivot table view) these columns appear blank. If multi-selection includes a mixture of both types of queries, data from all queries gets exported, while pivot tables at excel end get created only for queries having distinct values for pivot fields as displayed in the list box. Depending upon user's choice, optional template can be used for creating the destination excel file. For this demonstration, the template file is located along with sample db in the same home folder. While suitable titles are inserted programmatically for all pivot table sheets, similar action for sheets holding exported data is implemented only if no template has been used. All utilized sheets (data as well as pivot table) get renamed as per respective exported queries. Exported data blocks are highlighted in color & provided with suitable borders. References: (a) Microsoft Excel Object library (version 9.0 or later) (b) Microsoft Scripting RunTime (c) DAO 3.6
|
|
Sponsored Links | Want a good read? Try The Summer of His Life (available on Amazon!) |
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |