Print Page | Close Window


Printed From: Roger's Access Library
Category: Other Download Libraries
Forum Name: Tejpal, A.D.
Forum Description: A.D. Tejpal's Library
Printed Date: 22 Jul 2018 at 2:42am

Topic: ExportAccessToExcelAsPivotTable.mdb
Posted By: A.D. Tejpal
Subject: ExportAccessToExcelAsPivotTable.mdb
Date 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.
        (a) Microsoft Excel Object library (version 9.0 or later)
        (b) Microsoft Scripting RunTime
        (c) DAO 3.6

Download Access 2K/XP/2K3: - uploads/37/


Email: -

Print Page | Close Window