Results 1 to 2 of 2

Thread: LibXL Examples

  1. #1
    Join Date
    Jul 2010
    Location
    São Paulo/Brazil
    Posts
    143

    Default LibXL Examples

    Hi guys,

    Does anyone has some examples to use LibXL to load/read a XLS/XLSX file and them, import it to Dataflex?
    The szLibXL.pkg from starzen has just examples to create a book/sheet, but I need to load/read.

    Regards
    Fernando
    Fernando Henrique Chacur de Faria
    Sao Paulo/SP - Brazil

    E-mail: fernandochacurdefaria@gmail.com
    Celular/WhatsApp: (11) 98443-8580

  2. #2
    Join Date
    Feb 2009
    Location
    Colombia
    Posts
    1,305

    Default Re: LibXL Examples

    Hi Fernando
    maybe this will help you

    Code:
                                            Get xlCreaBook True     to hoBook   // true means xml xlsx
                                            Send ComLoad to hoBook sFilePath
                                            Get ComGetSheet of hoBook 0 to vSheet
                                            If (not(IsNullComObject(vSheet))) Begin
                                                Get Create (RefClass(cszLibXLSheet)) to hoSheet
                                                Move 0 to iRow
                                                If (bTitulos) Move 1 to iRow
                                                If (hoSheet) Begin
                                                  Move (Status_Panel(Self)) to StatPnl
                                                  Send Initialize_StatusPanel of StatPnl "Importando terceros" " No Interrumpa !!" " Importando ..."
                                                  Send Start_StatusPanel of StatPnl
                                
                                                   Set pvComObject of hoSheet to vSheet
                                                   Get ComReadStr of hoSheet iRow 0 to sTipodoc
                                                   Get ComReadStr of hoSheet iRow 1 to nNoDcmto
                                                   Get ComReadStr of hoSheet iRow 2 to s1Nombre
                                                   Get ComReadStr of hoSheet iRow 3 to s2Nombre
                                                   Get ComReadStr of hoSheet iRow 4 to s1Apellido
                                                   Get ComReadStr of hoSheet iRow 5 to s2Apellido
                                                   Get ComReadStr of hoSheet iRow 6 to sDireccion
                                                   Get ComReadStr of hoSheet iRow 7 to sEmail
                                                   Get ComReadStr of hoSheet iRow 8 to sCedula
                                                  
                                                   Get ComLastRow of hoSheet to iLastRow 
                                                   While  (iRow<=iLastRow)  
                                                       Send Update_StatusPanel of StatPnl ("["+String(iRow)+"/"+String(iLastRow)+"]"+String(nNoDcmto))
                                                        Move True to bOk
                                                        If (nNoDcmto>0) Get IncorporaCedulas sTipodoc nNoDcmto s1Nombre s2Nombre s1Apellido s2Apellido sDireccion sEmail sCedula to bOk
                                                        If (not(bOk)) Increment iConteo
                                                        Increment iRow
                                                           Get ComReadStr of hoSheet iRow 0 to sTipodoc
                                                           Get ComReadStr of hoSheet iRow 1 to nNoDcmto
                                                           Get ComReadStr of hoSheet iRow 2 to s1Nombre
                                                           Get ComReadStr of hoSheet iRow 3 to s2Nombre
                                                           Get ComReadStr of hoSheet iRow 4 to s1Apellido
                                                           Get ComReadStr of hoSheet iRow 5 to s2Apellido
                                                           Get ComReadStr of hoSheet iRow 6 to sDireccion
                                                           Get ComReadStr of hoSheet iRow 7 to sEmail
                                                           Get ComReadStr of hoSheet iRow 8 to sCedula
                                                   End
                                                   Send Stop_StatusPanel of StatPnl
                                                   Send Info_Box ("Proceso terminado ["+String(iConteo)+"/"+String(iRow)+"]")
                                                 End
                                                 Send Destroy to hoSheet
                                           End       
                                    End
    Edgar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •