FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Import and Export to Excel
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Import and Export to Excel
Posted: Tue Apr 23, 2019 07:41 AM
It can be seen from the description of the error that the out of memory error is with oRange:Value(), not ArrTranspose()
Please try:

Code (fw): Select all Collapse
aData := oRange:Value
aData := ArrTranspose( aData )
Regards



G. N. Rao.

Hyderabad, India
Posts: 65
Joined: Fri Feb 13, 2009 12:03 PM
Re: Import and Export to Excel
Posted: Sat Apr 27, 2019 04:55 AM
Hi Rao,

Same result:

==========
Called from: => TOLEAUTO:VALUE( 0 )
Called from: excelrange2.prg => TEST( 10 )

System
======
CPU type: AMD Athlon(tm) II X3 425 Processor 2712 Mhz
Hardware memory: 4064 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Windows total applications running: 7
1 ,
2 , C:\Windows\syswow64\SHELL32.dll
3 , C:\Windows\syswow64\SHLWAPI.dll
4 , D:\projects\fwh1706\excelrange\excelrange2.exe
5 DDE Server Window, C:\Windows\syswow64\OLE32.DLL
6 GDI+ Window, C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.17514_none_72d18a4386696c
7 MCI command handling window, C:\Windows\system32\WINMM.DLL

Variables in use
================
Procedure Type Value
==========================
TOLEAUTO:VALUE
Local 1: U
Local 2: C "Excel.Application:WORKBOOKS:ACTIVESHEET:USEDRANGE"
TEST
Local 1: O Class: TOLEAUTO
Local 2: L .F.
Local 3: U
Local 4: U

Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFNTX

DataBases in use
================

Classes in use:
===============
1 ERROR
2 HASHENTRY
3 HBCLASS
4 TOLEAUTO
5 HBOBJECT
6 TREG32
7 TSTRUCT

Memory Analysis
===============
377 Static variables

Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes

Code (fw): Select all Collapse
#include "fivewin.ch"

// shortest way to open and read Excel file...............

Function test()
    Local oRange,lOpened:=.f.
    Local aData, oClip
    
     oRange   := GetExcelRange( ExePath() + "Large file - All Data.xlsx" )
     aData := oRange:Value
         aData := ArrTranspose( aData )
     xbrowse( aData )

       oRange:WorkSheet:Parent:Close()
     oRange   := NIL
     
return nil

function ExePath()
return cFilePath( GetModuleFileName() )
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Import and Export to Excel
Posted: Sat Apr 27, 2019 05:24 AM

That was what I meant.
This is an error with Excel OLE.
Not an error with any FWH function like ArrTranpose()

Excel OLE is unable to handle very large xls files.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion