The overall process is linking MS Excel 2013, via the PowerPivot Data Model, to MS Access 2013. From the PowerPivot Data Model, I set up SQL queries which come through as Tables in PowerPivot Data Model. From the Tables, I create PivotCharts and PivotTables which are placed into the MS Excel Sheets. The PivotCharts and PivotTables are then formatted. I then create UserForms into which the PivotCharts and PivotTables are displayed for the users of MS Excel. These are then printed and saved as images (jpg) for the users of MS Excel.
However the problem I have is that there are hundreds of spreadsheets to set up in MS Excel, each with numerous PivotCharts and PivotTables, therefore I am looking for help on how to automate this process with Visual Basic for Applications rather.
I have managed to work out how to use Visual Basic for Applications to automate most of the formatting of the PivotCharts and PivotTables, and am left with the following specific tasks to automate with Visual Basic for Applications:
- Automate Connection between MS Excel PowerPivot Data Model and MS Access (with VBA)
- In PowerPivot Data Model
- Set up PowerPivot Data Model database connection to MS Access
- Set up Table consisting of SQL query to the database
- Create PivotTables and PivotCharts in the Sheets from the Table
- In sheets
- Rename sheets tab (this sheet name is referred to when formatting therefore is required)
- Name the range of the PivotTable and PivotCharts (this range is referred to when formatting therefore is required)
- Select required attributes to be shown in the PivotTable and PivotCharts as fields
- Format Tables (with VBA)
- In sheets
- Hide sub-totals
- Remove the border shadow on the table
- Hide filter drop-down icons
- Format Charts (with VBA)
- In sheets
- Extend pie chart type PivotCharts overlapping labels to display leader lines neatly
- Sort Legend items from A to Z
- Create UserForms (with VBA)
- Automate the template creation
- Assign a Save As button to save the form/image as any document/file type and to any file folder.