Results 1 to 2 of 2

Facing "out of memory" issue while importing data from a .csv file to create Pivot Cache

Threaded View

SeriousDeveloper Facing "out of memory" issue... 12-20-2013, 01:48 AM
:) Sixthsense :) Re: Facing "out of memory"... 12-20-2013, 03:42 AM
  1. #1
    Registered User
    Join Date
    12-20-2013
    Location
    San Jose ,CA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Facing "out of memory" issue while importing data from a .csv file to create Pivot Cache

    Hi All,

    I need a help on this issue which we are facing.

    We are trying to create pivot cache from an external .csv file.

    This works fine when the csv file is small (<500 mb).
    But it given "out of memory" error for bigger .csv files(>~500 mb).

    Attaching sample code for reference -


    Dim cConnection As ADODB.Connection
    Dim rsRecordset As ADODB.Recordset
    Dim pvtCache As PivotCache
    Dim pvtTable As PivotTable
     Dim SQL As String
    
    ''Creating ADODB connection object
     Set cConnection = New ADODB.Connection
     cConnection.Open sConnStrP1 & sFilePath & sConnStrP2
    
    '' where
    '''Const sConnStrP1 = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq="
    '''Const sConnStrP2 = ";Extensions=asc,csv,tab,txt;Persist Security Info=False"
    '''Const sFilter = "CSV File, *.csv"
    
    
      Set rsRecordset = Nothing
        Set rsRecordset = New ADODB.Recordset
        Set rsRecordset = cConnection.Execute(SQL)
                
    ''Creating pivot cache from csv file
        Set pvtCache = ThisWorkbook.PivotCaches.Create(SourceType:=xlExternal)
        Set pvtCache.Recordset = rsRecordset
    
    ''Using Pivot cache to create pivot table
     arrTmp = Array("NoRow")
     Set pvtTable = createPivotTable(arrTmp, wsTemp.Range("f15"), pvtCache)
     pvtTable.Name = "ptbl_1"
    Is there a way we can solve this issue. If not what is the best way to create a pivot table for >4-5 millions records.

    It will be great help if someone can put some helpful pointers.

    Moderator Note:

    Pls use code tags around your code next time as per forum rules.
    Last edited by Fotis1991; 12-20-2013 at 03:58 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  2. Replies: 2
    Last Post: 07-26-2010, 06:59 AM
  3. Transfert cell values from file "A" to file "B" skipping columns in file "B".
    By Sentrosi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2009, 11:11 PM
  4. [SOLVED] importing a text file - problem with dates "Americanising"
    By strippier in forum Excel General
    Replies: 3
    Last Post: 02-21-2006, 01:45 PM
  5. Damaged file? ("Not enough memory").
    By Doctor Slump in forum Excel General
    Replies: 1
    Last Post: 03-01-2005, 05:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1