Posts: 858
Threads: 196
Joined: Apr 2005
Macro
Macro7
ExcelSheet es.Init
Excel.Range r=es.ws.Application.Selection
out r.Comment.Text
This code works when cell A1 is selected; return the comment.
When A1 and B1 are merged
The code fails and return
Error (RT) in Macro7: invalid interface pointer. Use _create or other function to create or get object
Do you know why?
Posts: 12,055
Threads: 140
Joined: Dec 2002
r.Comment returns 0.
It means that Excel does not give you a Comment object.
-----
r.Comment.Text calls 2 functions:
Excel.Comment c=r.Comment
out c ;;0
str s=c.Text ;;error because c is 0
Posts: 858
Threads: 196
Joined: Apr 2005
How can I get the comment of mergecell?
Posts: 12,055
Threads: 140
Joined: Dec 2002
Macro
Macro1288
ExcelSheet es.Init
Excel.Range r=es.ws.Application.Selection
;out r.Comment.Text ;;error
;out r.Cells.Count ;;>1 for merged cells
r=r.Cells.Item(1 1) ;;get top-left cell
out r.Comment.Text
;there are multiple cells in the merged cells.
;get comment of the first cell.
Posts: 858
Threads: 196
Joined: Apr 2005
Posts: 858
Threads: 196
Joined: Apr 2005
Can you add in new version:
ExcelSheet.Cell ---->
function~ `column [row] [flags] [int&vt] ;;column: index or string like "A" or "A1". flags: get 1 date as number, 2 formula, 3 text, 4 comment