Jump to content
Fivewin Brasil

importar Excel com várias ABAS


EDUTEK

Recommended Posts

Boa tarde

 

Estou precisando importar uma planilha do excel que tem vários planilhas todas nomeadas, como falo para ler somente uma ou como faço para escolher pois cada uma vou alimentar uma tabela diferente.

tenho a planilha  TABELA DE CUSTOS.XML

 

depois tenho dentro dela as seguinte "frotas", "motoristas", "oficina", etc... 

 

Link to comment
Share on other sites

Edu, não sei se vc já resolveu, veja se ajuda!

- Detalhe fiz mas não testei ainda...não tenho o excel instalado!

#include "FiveWin.ch"

Function main()

Ler_planXLS("c:\temp\exemplo.xls")
return nil


function Ler_planXLS(cFile)
Local oBook,i,aVet,oExcel,oSheet


oExcel     := CreateObject("Excel.Application")
oBook      := oExcel:Workbooks:Open( cFile )
//oBook := oExcel:Workbooks:Add()
oSheet     := oBook:Worksheets( 1 ) //planilhas


For i = 1 To oExcel:Sheets:Count() //oBook:Sheets:Count
    aVet :=  oBook:Sheets(i):Name   //oSheet:Name

Next

XBrowse(aVet)

Return nil

Este site pode te ajudar:

https://msdn.microsoft.com/en-us/VBA/Excel-VBA/articles/xlfileformat-enumeration-excel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...