Import and Export to Excel

Re: Import and Export to Excel

Postby nageswaragunupudi » Tue Apr 23, 2019 7: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: Select all  Expand view

aData := oRange:Value
aData := ArrTranspose( aData )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Import and Export to Excel

Postby ryugarai27 » Sat Apr 27, 2019 4: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:OPEN: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: Select all  Expand view
#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() )
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: Import and Export to Excel

Postby nageswaragunupudi » Sat Apr 27, 2019 5: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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: EASYSOFT, Google [Bot] and 20 guests