List Info

Thread: Re: Saving an existing Excel file from delphi




Re: Saving an existing Excel file from delphi
country flaguser name
United States
2007-06-08 04:12:31

Hi Mike Shkolnik,

it is working fine.

Many Thanks !!!!

Kiran
___________________________



Mike Shkolnik < mshkolnik%40yahoo.com">mshkolnikyahoo.com> wrote:
Hello,

use the DisplayAlerts property:

...
XLApp.DisplayAlerts := False;
XLApp.Workbooks[1].SaveAs(XlsFileName);

With best regards, Mike Shkolnik
EMail: mshkolnik%40scalabium.com">mshkolnikscalabium.com
http://www.scalabium.com

--- kiran delphi < kirandelphi%40yahoo.com">kirandelphiyahoo.com> wrote:

> Hi all,
>;
> Can any one help me on this please......I have a
> query regarding saving an Excel file from Delphi.I
> have a existing Excel file .From Delphi I open this
>; Excel file and wirting into it.
>
> While saving the Excel file it will dislplay a
> confirm dialog box with a message text " A
> filename c:book1.xls already exists in this
>; location .Do you want to replace it ?"
> How can i overwrite/save this file from delphi
&gt; with out a confirm dialog box displayed....Please
> help me .
> Please see the code below.....
>
>
> Var
> XLApp: Olevariant;
> XlsFileName : string;
> Sheet Variant;
>
>
> XlsFileName :='c:book1.xls';
&gt; XLApp := CreateOleObject('Excel.Application');
&gt; XLApp.Visible :=false;
> XLApp.Workbooks.Open(XlsFileName);
> Sheet := XLApp.Workbooks[1].Worksheets[1];
>
> XLApp.Cells[2,1].value :='Computer' ;
> Sheet.Cells[2,2] :='systems' ;
> XLApp.Workbooks[1].saveas(XlsFileName);
>
>
> Thanks in advance
> Kiran Kumar

With best regards, Mike Shkolnik
EMail: mshkolnik%40scalabium.com">mshkolnikscalabium.com
http://www.scalabium.com

__________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&amp;sid=396545469

---------------------------------
Moody friends. Drama queens. Your life? Nope! - their life, your story.
Play Sims Stories at Yahoo! Games.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )