Results 1 to 10 of 12

Thread: LibXL

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Jun 2011
    Location
    Brazil
    Posts
    59

    Default Re: LibXL

    Fernando,

    Baixei o produto, dentro dele tem exemplos com VB6, daí usando External_Function, consegui abrir um XLSX e ler o mesmo.

    Não é complicado não, só dá um pouco de trabalho.

    Em anexo o que fiz até o momento e o botão que fiz o teste.

    Code:
        Object oBTN_Open is a Button
            Set Location to 6 25
            Set Label to 'Open'
            Procedure OnClick
                Handle  hoBook hoSheet hoFormat
                Integer iRet
                String  sError
                Move 0 to hoBook
                Move (xlCreateBook()) to hoBook
                Move (xlCreateXMLBook()) to hoBook
                
                Move (xlBookLoad(hoBook,"C:\ArquivosImportacao\medicamentos.xlsx")) to iRet
                Move (xlBookErrorMessage(hoBook)) to sError
                If (Trim(sError)<>'ok') Send Info_Box sError iRet
                Move (xlBookGetSheet(hoBook,0)) to hoSheet
                Move (xlBookErrorMessage(hoBook)) to sError
                If (Trim(sError)<>'ok') Send Info_Box sError iRet
                
                String sValue
                //Move (xlSheetCellFormat(hoSheet,1,1)) to hoFormat
                Move (ToOEM(xlSheetReadStr(hoSheet,1,0,(&hoFormat)))) to sValue
                //Move (xlSheetReadComment(hoSheet,1,1)) to sValue
                Send Info_Box sValue
                
            End_Procedure
        
        End_Object
    
    Queiroz
    Attached Files Attached Files

Posting Permissions

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