Cita:
Empezado por Casimiro Notevi
Mejor que pongas tu código.
|
He ido comentando partes del código del ejemplo y he conseguido "aislar" las partes que generan el problema. Con ellas comentadas, el fichero se genera correctamente.
A ver si así se os ocurre algo a alguno.
Un saludo
Código Delphi
[-]Procedure Tfrm_MainWindow.btn_StartClick( Sender: TObject );
Var
I: Integer;
Begin
With mxNativeExcel1 Do
Begin
NewFile;
FileName := ChangeFileExt( ParamStr( 0 ), '' );
AddFont( Label2.Font );
AddFont( Label1.Font );
Row := 4;
Column := 1;
ActiveFont := 0;
WriteNumber( 2147400000 );
For I := 0 To 100 Do WriteInteger( I );
Row := 7;
Column := 1;
For I := 0 To 100 Do
Begin
If I Mod 2 = 0 Then ActiveFont := 0 Else ActiveFont := 1;
Shading := ActiveFont = 1;
WriteInteger( Row + I, I * 2, I );
End;
Shading := FALSE;
SetColumnWidth( 1, 53 );
SetColumnWidth( 3, 10, 10 );
Borders := [ ebTop, ebBottom, ebLeft, ebRight ];
WriteBoolean( 6, 1, TRUE );
WriteBoolErr( 7, 1, beNA );
SetLeftMargin( 0.30 ); SetBottomMargin( 0.30 ); SetTopMargin( 0.30 ); SetRightMargin( 0.30 );
ProtectSheet( TRUE );
CloseFile;
SaveToFile;
End;
End;