Solved

create a pivot table from visual basic

Posted on 2013-12-10
1
488 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Split a string in excel 9 33
Most Consistent Performer 4 20
Issues with DAX Calculated Columns 6 12
Crystal reports vb.net 2 0
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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 demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

910 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

21 Experts available now in Live!

Get 1:1 Help Now