FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour error with Excel and ArrayTranspose sample Mr. Rao
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
error with Excel and ArrayTranspose sample Mr. Rao
Posted: 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 (fw): Select all Collapse
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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: error with Excel and ArrayTranspose sample Mr. Rao
Posted: Sat Mar 17, 2012 05: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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: error with Excel and ArrayTranspose sample Mr. Rao
Posted: 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.

Continue the discussion