Solved

create a pivot table from visual basic

Posted on 2013-12-10
1
507 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

735 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