 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Raymundo Perez Guest
|
Posted: Mon Jun 23, 2003 3:07 pm Post subject: Re: Excel comments for cell |
|
|
thank you
"Wilfried Knöll" <willi.knoell (AT) t-online (DOT) de> wrote
| Quote: | Hi,
i tried the following sequence and it was ok.
procedure TForm1.SpeedButton1Click(Sender: TObject);
Var
vDoc : Variant ;
xCol,
yRow : Integer ;
begin
vDoc := OleContainer1.OleObject ;
xCol := 1 ;
yRow := 1 ;
Repeat
vDoc.ActiveSheet.Cells[yROW,xCOL].Value := 'VALUE' ;
vDoc.ActiveSheet.Cells[yROW,xCOL].addcomment.text (Format
('%d-----%d',[xCol, yRow])) ;
Inc (xCol) ;
If xCol=10
Then
Begin
xCol := 1 ;
Inc (yRow)
End
Until yRow = 10
end ;
In your sequence " excel.Cells.Item[yROW,xCOL].Value(
AdoQuery1BGItemName.asstring );" is wrong. See may example above.
---
Willi
Raymundo Perez schrieb:
May be I expresed myself wrong but I want to add commentary to a
diferent
cells
This Is The Almost Complete code Of what I am Doing;
And Somehow It's lead me to a error just on the second round
yRow:=1;
Xcol:=1;
AdoQuery1.First;
Repeat
excel.Cells.Item[yROW,xCOL].Value( AdoQuery1BGItemName.asstring );
excel.Cells.Item[yROW,xCOL].addcomment.text(
AdoQuery1BGItemNote.asstring );
Inc(xCol);
If xCol=10
then
Begin
xCol:=1;
Inc(yRow);
End;
AdoQuery1.Next;
Until AdoQuery1.Eof;
"Wilfried Knöll" <willi.knoell (AT) t-online (DOT) de> wrote in message
news:3EF00323.4C34B58C (AT) t-online (DOT) de...
Hi,
you can only add one comment to a cell. The following macro shows the
error
handling :
Sub InsertComment ()
On Error GoTo ErrorHandler
With ActiveCell
.AddComment
.Comment.Visible = True
.Comment.Text Text:="Comment"
End With
Exit Sub
ErrorHandler:
MsgBox "This cell already has a comment !"
End Sub
Raymundo Perez schrieb:
I am trying to add comments to a cell
The first time when This line executed comment is added ok
But When the second time It generate an error.
I presume that I missed something like changing comment ID or
something
like
that
Please help me out
That what I use
excel.Cells.Item[yROW,xCOL].addcomment.text(SomeText);
______________
Raymundo Perez
roskiy
--
Mit freundlichen Grüßen
Willi Knöll
Tel.: 02687 929543
|
|
|
| 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
|
|