ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to create pivot table from web query (https://www.excelbanter.com/excel-programming/406031-how-create-pivot-table-web-query.html)

Smugliy

How to create pivot table from web query
 
Hi ,PLEASE help me to create programmaticly pivot table from web query

My code for creating table query :
Excel.Worksheet ws = new Excel.WorksheetClass();
string strCellAddress =
applicationObject.ActiveCell.get_Address(1, 1, Excel.XlReferenceStyle.xlA1,
System.Type.Missing, System.Type.Missing);
ws =
(Excel.Worksheet)applicationObject.ActiveWorkbook. ActiveSheet;
object async = false;

Excel.Range rngDestination =
applicationObject.get_Range(strCellAddress, System.Type.Missing);
object connection = "URL;http://someUrlHere...";
Excel.QueryTable tblQuery = ws.QueryTables.Add(connection,
rngDestination, System.Type.Missing);
tblQuery.BackgroundQuery = true;
tblQuery.TablesOnlyFromHTML = true;
tblQuery.Refresh(async);
tblQuery.SaveData = true;


this code is fill excel with data .And I want to create from it pivot table
without filling excel with data.Is it possible?

help me please,

smugliy


All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com