 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
balin Guest
|
Posted: Mon Sep 19, 2005 3:20 pm Post subject: Excel replace string |
|
|
Hi all,
I have this code :
ExcelApp.Connect;
ExcelApp.Workbooks.Open('test.xls', EmptyParam, EmptyParam, EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, 0);
ExcelApp.Visible[0] := True;
ExcelSheet.ConnectTo(ExcelApp.Sheets[1] as _worksheet);
ExcelSheet.UsedRange[0].Replace('#test#', '01/01/2005', xlPart, xlByRows,
False, False);
I have this problem: when i replace the string in a cell, i lose any
formatting, font and other cell
properties...why ? there is another way to make this ?
Thank's in advanced for answer.
Marco.Italy
|
|
| Back to top |
|
 |
George Birbilis Guest
|
Posted: Tue Sep 20, 2005 9:05 am Post subject: Re: Excel replace string |
|
|
I think you shouldn't just set a string to the cell, but set the "Text"
property (or maybe called "Value") of the cell so that you keep the
formatting
-----
George Birbilis (birbilis (AT) kagi (DOT) com)
Microsoft Most Valuable Professional
MVP J# for 2004 & 2005
http://www.kagi.com/birbilis
QuickTime, Delphi, ActiveX, .NET, IPC
--------------
"balin" <balin (AT) xxx (DOT) it> wrote
| Quote: | Hi all,
I have this code :
ExcelApp.Connect;
ExcelApp.Workbooks.Open('test.xls', EmptyParam, EmptyParam, EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, 0);
ExcelApp.Visible[0] := True;
ExcelSheet.ConnectTo(ExcelApp.Sheets[1] as _worksheet);
ExcelSheet.UsedRange[0].Replace('#test#', '01/01/2005', xlPart, xlByRows,
False, False);
I have this problem: when i replace the string in a cell, i lose any
formatting, font and other cell
properties...why ? there is another way to make this ?
Thank's in advanced for answer.
Marco.Italy
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|