Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comments Merge cells in Excel
#1
Macro Macro7
Code:
Copy      Help
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?
#2
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
#3
How can I get the comment of mergecell?
#4
Macro Macro1288
Code:
Copy      Help
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.
#5
Thanks.
#6
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


Forum Jump:


Users browsing this thread: 1 Guest(s)