View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Smugliy Smugliy is offline
external usenet poster
 
Posts: 10
Default 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