Hi Tod,
    The problem with the green triangles, is that the excel is very good
    as report tool for ecomomic anual results, and used in a lot of system 
solutions
    for send to a lot of people in diferent machines, and sending excel with
    VBA, is not a solution in Security and dont work with tools like "Cal 
OpenOffice.org".
    Changing the Global options in Excel in all client machines is not nice.

    I use excel as a "Report Tool" and "Custom Sales calulations", using 
range .Format you cant paint cells
    change, formats font colors, borders etc.., you can see the example 
below.


    Monday i send some examples using FieldDataType


Example Code from http://lib.seven.com.br/ampliar.asp?codcat=1&codartigo=333
procedure TForm1.Button1Click(Sender: TObject);
var WorkBk    : _WorkBook;
    WorkSheet : _WorkSheet;
    FileName  : String;
begin
   ExcelApplication1.Connect;
   Try
      FileName := 'c:\\windows\\desktop\\demo.xls';
      ExcelApplication1.Visible[0] := False;
      ExcelApplication1.DisplayAlerts[0] := False;
      ExcelApplication1.WorkBooks.Add(xlWBatWorkSheet,0);
      WorkBk := ExcelApplication1.WorkBooks.Item[1];
      WorkSheet := WorkBk.WorkSheets.Get_Item(1) as _WorkSheet;
      WorkSheet.Name := 'Exemplo';

      WorkSheet.Cells.Item[1,1].Value:='Mês';
      WorkSheet.Cells.Item[1,2].Value:='Valor';

       Worksheet.Range['A2','A2'].Value := 'Janeiro';
      Worksheet.Range['A3','A3'].Value := 'Fevereiro';
      Worksheet.Range['A4','A4'].Value := 'Março';
      Worksheet.Range['A5','A5'].Value := 'Soma';

      Worksheet.Range['B2','B2'].Value := 3210;
      Worksheet.Range['B3','B3'].Value := 4432;
      Worksheet.Range['B4','B4'].Value := 3231;


      Worksheet.Range['B5','B5'].Value := '=SUM(B1:B3)';


      Worksheet.Columns.Font.Bold := True;
      Worksheet.Columns.HorizontalAlignment := xlRight;
      WorkSheet.Columns.ColumnWidth := 14;

      WorkSheet.Range['A2','A4'].Font.Color := clBlue;
      WorkSheet.Range['A2','A4'].HorizontalAlignment := xlHAlignLeft;
      WorkSheet.Range['A2','A4'].ColumnWidth := 31;

      WorkSheet.Range['B2','B5'].Font.Color := clRed;
      WorkSheet.Range['B2','B5'].NumberFormat := '#.##0,00';


      
ExcelApplication1.ActiveWorkbook.SaveAs(FileName,xlNormal,'','',false,false,xlNochange,xlUserResolution,False,EmptyParam,EmptyParam,0);
      ExcelApplication1.Quit;
   Finally
      ExcelApplication1.Disconnect;
   End;
end;


Regards

Flávio Maurício

the Option
----- Original Message ----- 
From: "Todd Fiske" <[EMAIL PROTECTED]>
To: "Delphi-Talk Discussion List" <[email protected]>
Sent: Thursday, November 10, 2005 6:38 PM
Subject: RE: Excel Automation


> Gies,Brad <[EMAIL PROTECTED]> wrote on Thu, 10 Nov 2005 11:57:31 -0500:
>
> > This one seems to work fairly well, but we're still getting the green
> > triangles on some columns and seemingly random cells. But it is much
> > better than what it was.
>
> Hi Brad,
>
> The green triangles can also be selectively turned off. This is the new
> Error Checking feature in Excel. Go to Tools> Options> Error Checking and
> you can either disable any individual check, or turn it all off 
> completely.
>
> I think this setting is global for Excel, but if you wanted to turn it off
> temporarily you could do it through automation as well. Just record a
> macro of turning something off, and go into the VBA editor and snip out
> the necessary code to use in Delphi.
>
> I was annoyed by the triangles at first but now I find they're quite
> helpful. They show up in Access too. For an Excel project I worked on
> recently, I wrote a VBA routine that goes through every sheet and lists
> every cell reference that has an error flag on it. Made it easy to find
> all the div by 0s and miscopied formulas on over 100 worksheets.
>
> - Todd
>
> __________________________________________________
> Delphi-Talk mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi-talk
> 

__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to