Brad use this
// to Covert your Index into Cell Range if you need
Function GetCellFor(Row,Column: Integer): string;
var
AddCol: Integer;
FirstCol: Integer;
begin
//(A to Z) 26 char (64 + 1) = A
//this will return the colunm to
If Column > 26 then
begin
AddCol := (Column mod 27)+1; //Secound Char
FristCol := Trunc((Column)/26); //First Char
result := Char(FristCol + 64) + Char((AddCol) + 64) + InttoStr(Row)
end
else//Just one Column Char
result := Char((Column) + 64) + InttoStr(Row);
end;
if all of your clients just use Microsoft excel you can use this and the
green triangles dont apear, but dont work with "calc openoffice" and version
2.0 is very good and free in portugal a lot of clients are using the
openoffice.org
Use the FWorksheet.Range['A1','A1'].Formula := '=ASC("' + Fields[I].AsString
+ '")';
or for your example
Cell := GetCellFor(RowCount, I + 2)
FWorksheet.Range[Cell,Cell].Formula := '=ASC("' + Fields[I].AsString + '")';
Regards
Flávio Maurício
----- Original Message -----
From: "Gies,Brad" <[EMAIL PROTECTED]>
To: "Delphi-Talk Discussion List" <[email protected]>
Sent: Thursday, November 10, 2005 4:57 PM
Subject: RE: Excel Automation
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.
Sincerely,
Brad Gies
-------------------------------------
NLM Software
Southfield, MI, USA
-------------------------------------
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:delphi-talk-
> [EMAIL PROTECTED] On Behalf Of Flávio Miguel dos Santos Maurício
> Sent: Thursday, November 10, 2005 11:34 AM
> To: Delphi-Talk Discussion List
> Subject: Re: Excel Automation
>
>
>
> > Hello Brad,
> >
> > or FWorksheet.Range['A1','A1'].Formula := '="' + Fields[I].AsString +
> > '"'';
> >
> > Regards
> >
> > Flávio Maurício
> >
>
> ----- Original Message -----
> From: "Flávio Miguel dos Santos Maurício" <[EMAIL PROTECTED]>
> To: "Delphi-Talk Discussion List" <[email protected]>
> Sent: Thursday, November 10, 2005 4:30 PM
> Subject: Re: Excel Automation
>
>
> > Hello Brad,
> >
> > I haved the same problem and use this solution
> >
> > FWorksheet.Range['A1','A1'].Formula := '=Text(' + Fields[I].AsString +
> ','
> > "")'
> >
> > Regards
> >
> > Flávio Maurício
> >
> >
> > .formula
> > ----- Original Message -----
> > From: "Gies,Brad" <[EMAIL PROTECTED]>
> > To: "Delphi-Talk Discussion List" <[email protected]>
> > Sent: Thursday, November 10, 2005 3:34 PM
> > Subject: Excel Automation
> >
> >
> >>
> >> I'm having an issue where a string field that I'm filling with data
> that
> >> looks like integers for the most part, is being formatted in Excel in
> >> scientific notation. How do I force these values to be displayed as
> >> strings.
> >>
> >> Below is the code used to fill the string fields. It's used in a case
> >> statement which checks the field type and then formats DateTimes and
> >> enter integers as an integer field:
> >>
> >> FWorksheet.Cells.Item[RowCount, I + 2] := Fields[I].AsString
> >>
> >> But I can't find a way to force this column or cell to be shown as a
> >> string.
> >>
> >>
> >>
> >> Sincerely,
> >>
> >> Brad Gies
> >> -------------------------------------
> >> NLM Software
> >> Southfield, MI, USA
> >> -------------------------------------
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> This e-mail is intended only for the person or entity to which it is
> >> addressed and may
> >> contain confidential and/or privileged material. Any review,
> >> retransmission,
> >> dissemination or other use of, or taking of any action in reliance
> upon,
> >> this information
> >> by persons or entities other than the intended recipient is prohibited.
> >> If you
> >> received this message in error, please contact the sender immediately
> and
> >> delete
> >> the material from your computer.
> >> __________________________________________________
> >> 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
This e-mail is intended only for the person or entity to which it is
addressed and may
contain confidential and/or privileged material. Any review,
retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information
by persons or entities other than the intended recipient is prohibited. If
you
received this message in error, please contact the sender immediately and
delete
the material from your computer.
__________________________________________________
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