Я знаю, вы не следили за VBA, но там новый объект CommentThreaded
теперь работает по крайней мере (Excel версия 1906, тестирование июнь 2019).
Я на самом деле тестировал его в Visual Studio C #, но онпо-прежнему не поддерживается.
По состоянию на 15 мая 2019 года новый объект CommentThreaded
описан Microsoft .
В моей версии Excel 1906 он полностью поддерживается в VBA.
Вот некоторый VBA-код, который немного поясняет обработку:
Private Sub ExcelsNewCommentThreaded()
Dim AllCommentsThreaded As Excel.CommentsThreaded
Dim OneCommentThreaded As Excel.CommentThreaded
Dim AllReplies As Excel.CommentsThreaded
Dim OneReply As Excel.CommentThreaded
Dim r As Range
Set AllCommentsThreaded = ActiveSheet.CommentsThreaded
' loop over all threaded comments of a worksheet and get their info
For Each OneCommentThreaded In AllCommentsThreaded
With OneCommentThreaded
Debug.Print .Author.Name, .Date, .Text
For Each OneReply In .Replies
With OneReply
Debug.Print .Author.Name, .Date, OneReply.Text
End With
Next OneReply
End With
Next OneCommentThreaded
Set r = Selection.Cells(1)
' check if the selected cell already contains a threaded comment
If r.CommentThreaded Is Nothing Then
r.AddCommentThreaded ("my new comment")
End If
With r.CommentThreaded
' get text of comment
Debug.Print .Text
' add some replies
.AddReply ("my reply 1")
.AddReply ("my reply 2")
' change text of comment
Debug.Print .Text(Text:="text of comment changed")
Debug.Print .Text
' change text of a reply
.Replies(1).Text Text:="text of reply 1 changed"
Debug.Print .Replies(1).Text
' delete second reply
.Replies(2).Delete
' delete whole comment including its replies
.Delete
End With
End Sub