Page 3 of 3

Re: Import and Export to Excel

Posted: Tue Apr 23, 2019 7:41 am
by nageswaragunupudi
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


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

Re: Import and Export to Excel

Posted: Sat Apr 27, 2019 4:55 am
by ryugarai27
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

#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() )

Re: Import and Export to Excel

Posted: Sat Apr 27, 2019 5:24 am
by nageswaragunupudi
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.