LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 390
Default VBA to create Pivot table from text file

Hello
I use vba in Access with an Excel reference to create a workbook containing
the data and generate a pivot table. The query is now generating 65K
records which exceeds what Excel can hold. I have had no luck in getting the
Excel reference to read data directly from the Acces table so I have decided
to export the data to text and use the text file as the data source for the
pivot table.

Bil xlApp as Excel.Application
Dim wb As Excel.Workbook
Dim ws As Excel.Worksheet
Dim pc As Excel.PivotCache

set xlapp = creatobject("Excel.Application")
Set xlwb = xlapp.workbooks.add
Set xlws = xlwb.sheets(1)


txtpath = "<path to data in a text file"

Set pc = ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
pc.connection = ??????

after that how do I access the data in the text file? as it has field names
but no tablename as such....

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create pivot table from existing pivot table in excel 2007 Udayraj Dhulekar Excel Discussion (Misc queries) 2 July 8th 13 08:22 PM
create pivot table from external csv file Sunny[_3_] Charts and Charting in Excel 5 February 12th 09 05:11 PM
Pivot Table - Create new file with ONLY certain data - Excel 2003 enna49 Excel Worksheet Functions 1 July 21st 07 05:00 AM
Macro to create pivot table from large data file johnson748r Excel Programming 1 August 9th 06 01:26 AM
How to create a Pivot table from text file with more than 65000 rows? morchard Excel Discussion (Misc queries) 0 June 29th 05 08:50 PM


All times are GMT +1. The time now is 02:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"