Jump to content
Fivewin Brasil

Criar Planilha com mais de uma aba office 2010


jfaguiar

Recommended Posts

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.
 

 

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...