Hi,

use the next code:

var
  xls, xlw: Variant;
begin
  xls := CreateOleObject('Excel.Application');
  xlw := xls.WorkBooks.Open('c:\aaa.xls');

  {integer numbers}
  xls.ActiveSheet.Columns[ColIndex1+1].NumberFormat :=
'0';

  {float numbers}
  xls.ActiveSheet.Columns[ColIndex2+1].NumberFormat :=
'0.00';

  {currency numbers}
  xls.ActiveSheet.Columns[ColIndex3+1].NumberFormat :=
'$0.00';

  xlw.Save;
  xlw.Close;
  xlw := UnAssigned;
  xls.Quit;
  xls := UnAssigned;
end;

PS: I wrote the code in message winbdow so maybe there
are some syntax errors for compile.

With best regards, Mike Shkolnik
EMail: [EMAIL PROTECTED]
http://www.scalabium.com

--- Ishen Seocharan <[EMAIL PROTECTED]> wrote:

> Hi All,
> 
>  
> 
> I am working with Delphi 5,6,7 and trying to find
> some source code that
> allows me to read an Excel worksheet and convert a
> column from text to
> numeric.
> 
>  
> 
> There is a manual process in Excel which requires
> you to go to each cell
> (not fun when it involves thousands of cells) but I
> want to select a
> column and convert.
> 
>  
> 
> Anyone has any source code for me.
> 
>  
> 
> Thanks in advance. 
> 
>  
> 
> Regards,
> 
> Ishen Seocharan
> 
> 
> -- 
> This e-mail and its contents are subject to the 
> South African Medical Research Council
> e-mail legal notice available at
> http://www.mrc.ac.za/about/EmailLegalNotice.htm



                
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to