Solved

create a pivot table from visual basic

Posted on 2013-12-10
1
484 Views
Last Modified: 2013-12-10
Hi Experts,
Please your help with some code to créate a pivot table from visual basic in excell
Here is what I have working until opening the Excel file with  the data

        Imports Excel = Microsoft.Office.Interop.Excel
        Dim XL As excel.Application
        XL = New excel.Application                                    
        XL.Visible = True
        XL.WindowState = excel.XlWindowState.xlMaximized
        Dim w2 As excel.Workbook = XL.Workbooks.Open(ss_tmp_fdr & "REP_C5.XLS")  

Everything else I have tred to créate the pivot table does not work

Regards!
0
Comment
Question by:rguillermo
1 Comment
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 39709594
My advice: turn on Excel's macro recorder, build the PT, and then use the auto-generated code as a guide.  You'll have to tweak it just a bit to conform to the VB.Net syntax, but that is the path of least resistance.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now