jfaguiar Posted April 14, 2020 Report Share Posted April 14, 2020 Boa tarde amigos. Como faço para criar uma planilha com mais de uma pasta na Texcel com Office 2010 ? No office 2013 deu certo, mas no 2010 não cria a segunda aba e os dados da aba2 sobrepõe as dados da primeira aba. Obrigado Segue o código: oExcel := TOleAuto():New( "Excel.Application" ) oExcel:WorkBooks:Add() oSheet := oExcel:Get( "ActiveSheet" ) oSheet:Name := "Em Atividade " nROW := 1 oSheet:Columns(1):ColumnWidth := 8 oSheet:Columns(2):ColumnWidth := 50 oSheet:Columns(3):ColumnWidth := 13 oSheet:Cells( nROW,01):Value := "Código" oSheet:Cells( nROW,02):Value := "Cliente" oSheet:Cells( nROW,03):Value := "Quant.Coletas" // Aba dois oExcel:Sheets:Add() oSheet := oExcel:Get( "ActiveSheet" ) oSheet:Name := "Clientes Ativos" // Aba2 nROW := 1 oSheet:Columns(1):ColumnWidth := 8 oSheet:Columns(2):ColumnWidth := 50 oSheet:Columns(3):ColumnWidth := 15 oSheet:Cells( nROW,01):Value := "Código" oSheet:Cells( nROW,02):Value := "Cliente" oSheet:Cells( nROW,03):Value := "Contratos Ativos" oSheet:Cells( 1, 1 ):Select() oExcel:Visible := .T. Quote Link to comment Share on other sites More sharing options...
ADutheil Posted April 15, 2020 Report Share Posted April 15, 2020 Veja se isso funciona. Não tenho 2010 para testar. // Aba dois oExcel:Sheets:Add() oExcel:WorkBooks(2):activate() oSheet := oExcel:Get( "ActiveSheet" ) 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.