tlunlun09
(tlunlun09)
November 2, 2023, 2:01pm
1
Excelの「コメントを挿入」機能で記述した文字列を取得する方法はありますでしょうか。
標準のアクティビティではないという認識ですが、いかがでしょうか。
お手数をお掛けしますが、ご教示いただけますと幸いです。
Yoichi
(Yoichi)
November 2, 2023, 11:08pm
2
こんにちは
例えばClosedXMLで取得可能です。InvokeCodeで
Using wb As New ClosedXML.Excel.XLWorkbook(filename)
Dim sheet As ClosedXML.Excel.IXLWorksheet = wb.Worksheet(sheetName)
strComment = sheet.Cell("A3").Comment.Text
End Using
以下のサンプルも参考にしていただければと思います。
Hi,
Unfortunately, there is no activity to handle comment in UiPath.Excel.Activites package.
We can achieve it using UiAutomation (Click, TypeInto and Shortcut etc), or how about using ClosedXML as the following?
[image]
Using wb As New ClosedXML.Excel.XLWorkbook(filename)
Dim sheet As ClosedXML.Excel.IXLWorksheet = wb.Worksheet(sheetName)
sheet.Cell("A1").Comment.AddText("Comment1")
sheet.Cell("A2").Comment.SetVisible.AddText("Comment2")
wb.Save()
End Using
Sample
Sample2…