Roger's Access Library Homepage
Forum Home Forum Home > Other Download Libraries > MS Access MVP Libraries > Tejpal, A.D.
  New Posts New Posts RSS Feed - ExportAccessToExcelAsPivotTable.mdb
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Please consider donating $1 per sample downloaded, (find out why here)


 Post Reply Post Reply
A.D. Tejpal View Drop Down
Microsoft MVP
Microsoft MVP

Joined: 30 Jun 2008
Status: Offline
Points: 192
Post Options Post Options   Thanks (0) Thanks(0)   Quote A.D. Tejpal Quote  Post ReplyReply Direct Link To This Post Topic: ExportAccessToExcelAsPivotTable.mdb
    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/


Back to Top
Sponsored Links

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.