Depois de um tempo procurando exportar meus relatórios para Excel, tentando com DLLs, "CreateObject( "ADODB.Connection" )" ou "CreateObject( "Excel.Application" )", achei uma forma fácil, rápida e sem a dependência de soluções de terceiros, que foi escrever um XML com o padrão que o Excel salva as planilha formato: "Planilha XML 2003 (*.xml)".
O Arquivo salvo nesse formato, nada mais é que um texto no padrão XML, criando ExcelWorkbook, Styles, Worksheet, Table, Column, Row, Cell e etc.
Qualquer um pode fazer o teste, abrindo o Excel, colocando algo nas células e salvando no formato XML aqui indicado, e aí vai ver como é registrado os dados, Fontes, Tamanhos de células, Fórmulas, Cores e por ai vai.
Não vou me estender muito e logo abaixo colocarei os fonte de como eu fiz, que é bem simples mesmo, pra todos verem e possam usar e contribuir.
Exemplo Main()
Código: Selecionar todos
Function Mail()
...
...
aTabela := {}
Use <tabela>
Set Filter ...
Do While !Eof()
...
...
...
If mExportarToExcel = 'S' //Adiciona as Rows da tabale
AAdd( aTabela, {;
Transform(qdd_uo, '@R 99.99.99'),;
Trim(TUO->TUO_titulo),;
qdd_fg,;
qdd_SF,;
qdd_pg,;
Transform(tpa_pa, '@R 9.999'),;
AlLTrim(TPA->TPA_titulo),;
qdd_ficha,;
Transform(qdd_ed, "@R 99.99.99"),;
Trim(TED->ted_titulo),;
qdd_fr,;
Trim( cl_ItemArray( aFROrigem, qdd_fr, 2) ),;
vl_fixatu ,;
mSupAnu ,;
mValor1 ,;
mValor2 ,;
hSaldo ;
})
Endif
...
...
...
Skip
Enddo
Use
If mExportarToExcel = 'S'
aCabecalho := {; //Monta o cabeçalho da tabela com Descriçào e largura da célula
{"U.O." , 047},;
{"U.O. Descri‡Æo", 200},;
{"F.G." , 047},;
{"Sub F.G." , 047},;
{"P.G." , 047},;
{"A‡Æo C¢digo" , 047},;
{"A‡Æo Descri‡Æo", 200},;
{"Ficha N£mero" , 047},;
{"Elemento C¢digo" , 047},;
{"Elemento Descri‡Æo" , 200},;
{"F.R. C¢digo" , 047},;
{"F.R. Descri‡Æo" , 200},;
{"Valor Fixado" , 070},;
{"Suplementado/Anulado", 070},;
{"Empenhado At‚ Mˆs" , 070},;
{"Previsto Final Ano" , 070},;
{"Saldo Atual" , 070};
}
If xmlGeraTabela(mArqXls, 'FichaDota‡Æo', aCabecalho, aTabela, 'Demonstrativo da Fixa‡Æo da Despesa e PrevisÆo para o resto do ano')
msg := 'O arquivo XLS(' + mArqXls + ') foi criado com sucesso. '
msg += CRLF+ 'Deseja abri-lo?'
If MsgYesNo( msg )
AbreArquivo( mArqXls )
EndIf
Endif
EndIf
...
...
Return nilCódigo: Selecionar todos
////////////////////////////////////////////////////////////////////////////////
/*
Funções pafa Gerar XML e salvar como .xls pra ler no Excel
-Exemplo de aCabecalho{}:
aCabecalho := {;
{"Data" , 047},;
{"DIA C¢digo" , 047},;
{"CAP C¢digo" , 047},;
{"PCASP Conta" , 070},;
{"Hist¢rico" , 200},;
{"Documento" , 100},;
{"U.O" , 047},;
{"Fonte Recurso" , 047},;
{"Valor D‚bito" , 070},;
{"Valor Cr‚dito" , 070},;
{"Saldo" , 070};
}
-Exemplo de registro SaldoInicial em aTabela{}:
AAdd( aTabela, {; //Linha de Totais
'01/' + pe_mm,;
'Saldo inicial',;
'Conta origem -->',;
Transform(aDados[i, 4], '@R 99999.99.99'),;
aDados[i, 5],;
Trim(cl_ItemArray(aTipoContaBancaria, aDados[i, 21], 2))+;
", Banco: " + aDados[i, 1] + ', Agˆncia: ' + aDados[i, 2] +;
', Conta Banc ria: ' + Transform(aDados[i, 3], '@R 999.999.999.999'),;
'',; //UO
'',; //FR
'',; //D‚bito
'',; //Cr‚dito
{'Saldo', aDados[i, 6]}; //Saldo
})
-Exemplo de registro TotalFinal em aTabela{}:
AAdd( aTabela, {; //Linha de Totais
'éltimo dia',;
'',;
'',;
'',;
'TOTAL DA CONTA BANCµRIA: Qtd - ' + Str(i, 5),;
'',;
'',;
'',;
{'Total', TDebSLD},;
{'Total', TCreSLD},;
{'Total', mSaldo};
})
-Exemplo de Hash com fórmula para coluna de aTabela{}.
hSaldo := {;
"Formula" => '=RC[-4]+RC[-3]-RC[-2]',;
"Number" => vl_fixatu + mSupAnu - mValor1 }
*/
////////////////////////////////////////////////////////////////////////////////
//#pragma -w0
//#pragma -es0
//#include "hbcompat.ch"
#define CRLF Chr(13)+Chr(10)
MemVar M_VERSAO, userName, nEmp
//////////////////////////////////////////////////////////////////////////////////
//FUNCOES PARA GERAR XLS
Function xmlGeraTabela(cFile, cWorksheetName, aCabecalho, aTabela, cRelName)
Local nHandle, r, nLenTabela := Len(aTabela) + 5
nHandle := xmlOpenBook(cFile, cWorksheetName, aCabecalho, nLenTabela, cRelName )
xmlWriteRow(nHandle, aTabela )
xmlRodape( nHandle, nLenTabela, Len(aCabecalho) -1 )
r := xmlClose( nHandle )
Return r
Function xmlAjustaString( cString )
cString := AllTrim( cString )
cString := StrTran( cString, CRLF, ' ' )
cString := StrTran( cString, Chr(10), ' ' )
cString := StrTran( cString, Chr(13), ' ' )
cString := StrTran( cString, Chr(141), ' ' )
cString := hb_strToUTF8( cString )
Return cString
Function xmlRodape(nHandle, nLenTabela, nLenCabecalho)
LOCAL mRow, nMergeLeft := Int( nLenCabecalho / 2), nMergeRight := nLenCabecalho - nMergeLeft -1
mRow := [ <Row ss:Index="] + LTrim(Str(nLenTabela)) + [" ss:AutoFitHeight="0">] + CRLF
mRow += ' <Cell ss:MergeAcross="' + LTrim(Str(nMergeLeft)) + '" ss:StyleID="CellRodapeLeft">' +;
'<Data ss:Type="String">'+ hb_strToUTF8('Usu rio: ' + AlLTrim(userName) ) +;
' | Data: ' + TtoC(DateTime()) + ' | SIAFIC: SCP21H / Ver: ' + M_VERSAO +;
' / File: ' + ProcFile(2) + '</Data></Cell>' + CRLF
mRow += ' <Cell ss:MergeAcross="' + LTrim(Str(nMergeRight)) +;
'" ss:StyleID="CellRodapeRight" ss:HRef="https://www.simplesinformatica.com.br/">' +;
'<Data ss:Type="String">www.SimplesInformatica.com.br</Data></Cell>' + CRLF
mRow += [ </Row>] + CRLF
FWrite(nHandle, mRow, Len(mRow))
Return nMergeRight
/////////////////////////////////////////////////////////////////////////////
//Para Cell com Formula, usa-se ss:Formula.
// - Ex.: col D [= A + B - C]. Levanta-se a array RC[x], onde seria o valor da posição de D - a posição da col a ser usada.
// - Explicando RC[] (R = Row e C = Col)
// - Ficando: < ... ss:Formula="=RC[-4]+RC[-3]-RC[-2]"><Data ...
FUNCTION xmlWriteRow(nHandle, aTabela )
LOCAL mRow, i, x
For i := 1 TO Len(aTabela)
mRow := [ <Row ss:AutoFitHeight="0">] + CRLF
For x := 1 To Len(aTabela[i])
If Valtype(aTabela[i, x]) = 'N'
mRow += [ <Cell ss:StyleID="ValorContabil"><Data ss:Type="Number">] + LTrim(Str(aTabela[i, x], 11,2)) + [</Data></Cell>] + CRLF
ElseIf Valtype(aTabela[i, x]) = 'A'
If aTabela[i, x, 1] = 'Saldo'
mRow += [ <Cell ss:StyleID="CellSaldo"><Data ss:Type="Number">] + LTrim(Str(aTabela[i, x, 2], 11,2)) + [</Data></Cell>] + CRLF
ElseIf aTabela[i, x, 1] = 'Total'
mRow += [ <Cell ss:StyleID="CellTotal"><Data ss:Type="Number">] + LTrim(Str(aTabela[i, x, 2], 11,2)) + [</Data></Cell>] + CRLF
Else
mRow += [ <Cell ss:StyleID="ValorContabil"><Data ss:Type="Number">] + LTrim(Str(aTabela[i, x], 11,2)) + [</Data></Cell>] + CRLF
Endif
ElseIf Valtype(aTabela[i, x]) = 'H'
mRow += [ <Cell ss:StyleID="ValorContabil" ss:Formula="] + aTabela[i, x]["Formula"] +["><Data ss:Type="Number">] + LTrim(Str(aTabela[i, x]["Number"], 11,2)) + [</Data></Cell>] + CRLF
Else
mRow += [ <Cell><Data ss:Type="String" x:Ticked="1">] + xmlAjustaString( aTabela[i, x] ) + [</Data></Cell>] + CRLF
Endif
Next
mRow += [ </Row>] + CRLF
FWrite(nHandle, mRow, Len(mRow))
Next nI
RETURN nil
/////////////////////////////////////////////////////////////////////////////
//Largura padrão das cell é 47, definido em <Column ss:Index="1" ss:AutoFitWidth="0" ss:Width="47"/>
//"ExpandedColumnCount" registra a quantidade de colunas da tabela
FUNCTION xmlOpenBook(cFile, cWorksheetName, aCabecalho, nRowCount, cRelName)
LOCAL nHandle, mBof := '', i
Local nMergeLeft := Int( (Len(aCabecalho) -1) / 2), nMergeRight := (Len(aCabecalho) -1) - nMergeLeft -1
mBof += [<!--SimplesInformatica.com.br-->] + CRLF
mBof += [<?xml version="1.0"?>] + CRLF
mBof += [<?mso-application progid="Excel.Sheet"?>] + CRLF
mBof += [<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"] + CRLF
mBof += [ xmlns:o="urn:schemas-microsoft-com:office:office"] + CRLF
mBof += [ xmlns:x="urn:schemas-microsoft-com:office:excel"] + CRLF
mBof += [ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"] + CRLF
mBof += [ xmlns:html="http://www.w3.org/TR/REC-html40">] + CRLF
mBof += [ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">] + CRLF
mBof += [ <Version>12.00</Version>] + CRLF
mBof += [ </DocumentProperties>] + CRLF
mBof += [ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">] + CRLF
mBof += [ <WindowHeight>10005</WindowHeight>] + CRLF
mBof += [ <WindowWidth>10005</WindowWidth>] + CRLF
mBof += [ <WindowTopX>120</WindowTopX>] + CRLF
mBof += [ <WindowTopY>135</WindowTopY>] + CRLF
mBof += [ <ProtectStructure>False</ProtectStructure>] + CRLF
mBof += [ <ProtectWindows>False</ProtectWindows>] + CRLF
mBof += [ </ExcelWorkbook>] + CRLF
mBof += [ <Styles>] + CRLF
mBof += [ <Style ss:ID="Default" ss:Name="Normal">] + CRLF
mBof += [ <Alignment ss:Vertical="Bottom"/>] + CRLF
mBof += [ <Borders/>] + CRLF
mBof += [ <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>] + CRLF
mBof += [ <Interior/>] + CRLF
mBof += [ <NumberFormat/>] + CRLF
mBof += [ <Protection/>] + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="CellCabeca">] + CRLF
mBof += [ <Borders>] + CRLF
mBof += [ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ </Borders>] + CRLF
mBof += [ <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" ss:Bold="1"/>] + CRLF
mBof += [ <Interior ss:Color="#EAF1DD" ss:Pattern="Solid"/>] + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="ValorContabil">] + CRLF
mBof += ' <NumberFormat ss:Format="#,##0.00_ ;[Red]\-#,##0.00\ "/>' + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="CellSaldo">] + CRLF
mBof += [ <Borders>] + CRLF
mBof += [ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ </Borders>] + CRLF
mBof += [ <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" ss:Bold="1"/>] + CRLF
mBof += [ <Interior ss:Color="#E5E0EC" ss:Pattern="Solid"/>] + CRLF
mBof += ' <NumberFormat ss:Format="[Blue]#,##0.00_ ;[Red]\-#,##0.00\ "/>' + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="CellTotal">] + CRLF
mBof += [ <Borders>] + CRLF
mBof += [ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ </Borders>] + CRLF
mBof += [ <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" ss:Bold="1"/>] + CRLF
mBof += [ <Interior ss:Color="#D8D8D8" ss:Pattern="Solid"/>] + CRLF
mBof += ' <NumberFormat ss:Format="[Blue]#,##0.00_ ;[Red]\-#,##0.00\ "/>' + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="CellRodapeLeft">] + CRLF
mBof += [ <Borders>] + CRLF
mBof += [ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
//mBof += [ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ </Borders>] + CRLF
mBof += [ <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="9" ss:Color="#4F6228" ss:Bold="1"/>] + CRLF
mBof += [ <Interior ss:Color="#D8D8D8" ss:Pattern="Solid"/>] + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="s74" ss:Name="Hyperlink">] + CRLF
mBof += [ <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#0000FF" ss:Underline="Single"/>] + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="CellRodapeRight" ss:Parent="s74">] + CRLF
mBof += [ <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>] + CRLF
mBof += [ <Borders>] + CRLF
mBof += [ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
//mBof += [ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ </Borders>] + CRLF
//mBof += [ <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#4F6228" ss:Bold="1"/>] + CRLF
mBof += [ <Interior ss:Color="#D8D8D8" ss:Pattern="Solid"/>] + CRLF
mBof += [ <Protection/>] + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="CabecalhoLeftTop">] + CRLF
mBof += [ <Borders>] + CRLF
mBof += [ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ </Borders>] + CRLF
mBof += [ <Font ss:FontName="Times New Roman" x:Family="Roman" ss:Size="14" ss:Color="#000000" ss:Bold="1"/>] + CRLF
mBof += [ <Interior ss:Color="#DBEEF3" ss:Pattern="Solid"/>] + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="CabecalhoLeftBottom">] + CRLF
mBof += [ <Borders>] + CRLF
mBof += [ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ </Borders>] + CRLF
mBof += [ <Font ss:FontName="Times New Roman" x:Family="Roman" ss:Size="13" ss:Color="#000000" ss:Bold="1"/>] + CRLF
mBof += [ <Interior ss:Color="#DBEEF3" ss:Pattern="Solid"/>] + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="CabecalhoRightTop">] + CRLF
mBof += [ <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>] + CRLF
mBof += [ <Borders>] + CRLF
mBof += [ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ </Borders>] + CRLF
mBof += [ <Interior ss:Color="#DBEEF3" ss:Pattern="Solid"/>] + CRLF
mBof += [ </Style>] + CRLF
mBof += [ <Style ss:ID="CabecalhoRightBottom">] + CRLF
mBof += [ <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>] + CRLF
mBof += [ <Borders>] + CRLF
mBof += [ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>] + CRLF
mBof += [ </Borders>] + CRLF
mBof += [ <Interior ss:Color="#DBEEF3" ss:Pattern="Solid"/>] + CRLF
mBof += [ </Style>] + CRLF
mBof += [ </Styles>] + CRLF
mBof += [ <Worksheet ss:Name="] + hb_strToUTF8(cWorksheetName) + [">] + CRLF
mBof += [ <Table ss:ExpandedColumnCount="] + LTrim(Str(Len(aCabecalho))) + [" ss:ExpandedRowCount="] + LTrim(Str(nRowCount)) + [" x:FullColumns="1" x:FullRows="1" ss:DefaultRowHeight="15">] + CRLF
For i := 1 To Len(aCabecalho)
mBof += [ <Column ss:Index="] + LTrim(Str(i)) + [" ss:AutoFitWidth="0" ss:Width="] + LTrim(Str(aCabecalho[i, 2])) + ["/>] + CRLF
Next
mBof += [ <Row ss:AutoFitHeight="0" ss:Height="19">] + CRLF
mBof += [ <Cell ss:MergeAcross="] + LTrim(Str(nMergeLeft)) +;
[" ss:StyleID="CabecalhoLeftTop"><Data ss:Type="String">] + xmlAjustaString( nEmp ) + [</Data></Cell>] + CRLF
mBof += [ <Cell ss:MergeAcross="] + LTrim(Str(nMergeRight)) +;
[" ss:StyleID="CabecalhoRightTop"><Data ss:Type="String">Top</Data></Cell>] + CRLF
mBof += [ </Row>] + CRLF
mBof += [ <Row ss:AutoFitHeight="0" ss:Height="19">] + CRLF
mBof += [ <Cell ss:MergeAcross="] + LTrim(Str(nMergeLeft)) +;
[" ss:StyleID="CabecalhoLeftBottom"><Data ss:Type="String">] + xmlAjustaString( cRelName ) + [</Data></Cell>] + CRLF
mBof += [ <Cell ss:MergeAcross="] + LTrim(Str(nMergeRight)) +;
[" ss:StyleID="CabecalhoRightBottom"><Data ss:Type="String">Valores em (R$)</Data></Cell>] + CRLF
mBof += [ </Row>] + CRLF
mBof += [ <Row ss:AutoFitHeight="0">] + CRLF
For i := 1 To Len(aCabecalho)
mBof += [ <Cell ss:Index="] + LTrim(Str(i)) + [" ss:StyleID="CellCabeca"><Data ss:Type="String">] + hb_strToUTF8( aCabecalho[i, 1] ) + [</Data></Cell>] + CRLF
Next
mBof += [ </Row>] + CRLF
nHandle := FCreate(cFile)
FWrite(nHandle, mBof, Len(mBof))
RETURN nHandle
/////////////////////////////////////////////////////////////////////////////
//Fecha e grava o arquivo.
//Retorna True se tudo der certo e False caso tenha acontecido algum erro ao gravar.
//FError() pode ser usado para conferir o erro
FUNCTION xmlClose( nHandle )
LOCAL mEof := '', r := .t.
mEof += [ </Table>] + CRLF
mEof += [ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">] + CRLF
mEof += [ <PageSetup>] + CRLF
mEof += [ <Header x:Margin="0.4921259845"/>] + CRLF
mEof += [ <Footer x:Margin="0.4921259845"/>] + CRLF
mEof += [ <PageMargins x:Bottom="0.984251969" x:Left="0.78740157499999996" x:Right="0.78740157499999996" x:Top="0.984251969"/>] + CRLF
mEof += [ </PageSetup>] + CRLF
mEof += [ <Unsynced/>] + CRLF
mEof += [ <Print>] + CRLF
mEof += [ <ValidPrinterInfo/>] + CRLF
mEof += [ <PaperSizeIndex>9</PaperSizeIndex>] + CRLF
mEof += [ <HorizontalResolution>600</HorizontalResolution>] + CRLF
mEof += [ <VerticalResolution>600</VerticalResolution>] + CRLF
mEof += [ </Print>] + CRLF
mEof += [ <Selected/>] + CRLF
mEof += [ <FreezePanes/>] + CRLF //Congela a primeira linha
mEof += [ <FrozenNoSplit/>] + CRLF
mEof += [ <SplitHorizontal>3</SplitHorizontal>] + CRLF
mEof += [ <TopRowBottomPane>3</TopRowBottomPane>] + CRLF
mEof += [ <ActivePane>2</ActivePane>] + CRLF
mEof += [ <Panes>] + CRLF
mEof += [ <Pane>] + CRLF
mEof += [ <Number>3</Number>] + CRLF
mEof += [ </Pane>] + CRLF
mEof += [ <Pane>] + CRLF
mEof += [ <Number>2</Number>] + CRLF
mEof += [ <ActiveCol>1</ActiveCol>] + CRLF
mEof += [ </Pane>] + CRLF
mEof += [ </Panes>] + CRLF
mEof += [ <ProtectObjects>False</ProtectObjects>] + CRLF
mEof += [ <ProtectScenarios>False</ProtectScenarios>] + CRLF
mEof += [ </WorksheetOptions>] + CRLF
mEof += [ </Worksheet>] + CRLF
mEof += [</Workbook>]
FWrite(nHandle, mEof, Len(mEof))
FClose(nHandle)
RETURN r


