Solved

create a pivot table from visual basic

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
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…

710 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