error with Excel and ArrayTranspose sample Mr. Rao

error with Excel and ArrayTranspose sample Mr. Rao

Postby lucasdebeltran » Fri Mar 16, 2012 10:18 am

Hello,

Checking a Mr. Rao´s post, I want to transfer a excel sheet to an Array:

Code: Select all  Expand view
function Main()


   local oRange
   local aArray   := {}
   local cExePath := cFilePath( GetModuleFileName() )




   // Driver CDX----------------------------------------------------------------
   REQUEST DBFCDX, DBFFPT

   RDDSETDEFAULT( "DBFCDX")





   oRange   := GetExcelRange( cExePath + "hoja.xls" )
   aArray   := ArrTranspose( oRange:Value )
   oRange:WorkSheet:Parent:Close()

   XBrowse( aArray )

   msgalert(aArray[1,1])



return nil



But it shows:

Error description: Error BASE/1004 No exported method: VALUE
Args:
[ 1] = U

Stack Calls
===========
Called from: => VALUE( 0 )
Called from: array.prg => MAIN( 34 )




Line 34 is: aArray := ArrTranspose( oRange:Value )


Any clue please?.


Thank you very much.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: error with Excel and ArrayTranspose sample Mr. Rao

Postby nageswaragunupudi » Sat Mar 17, 2012 5:54 am

oRange must be nil.
Please check if oRange is a valid range before calling oRange:Value.

oRange can be nil, if the excel file could not be opened (for whatever reason) or some other reason.
Regards

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

Re: error with Excel and ArrayTranspose sample Mr. Rao

Postby lucasdebeltran » Sun Mar 18, 2012 10:34 am

Yes, it ´s nill. You are a Master.

Is there any way to retrive the error?. Because the operation of GetExcelRange does not show any errors.

Thank you very much.


PD: B the way, please any tips to increase xBrowse speed with ADS/AIS?.

Thank you again. Do you have a blog about Fivewin and Harbour?.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 53 guests

cron