EDUTEK Posted April 25, 2018 Report Share Posted April 25, 2018 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... Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted April 27, 2018 Report Share Posted April 27, 2018 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 Quote Link to comment Share on other sites More sharing options...
EDUTEK Posted April 27, 2018 Author Report Share Posted April 27, 2018 ok vou testar Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.