Hi All,
I’m trying to remove only the comment/note from a particular Excel cell (e.g., B5) using UiPath without deleting the cell value.
I tried the Invoke VBA approach with the below code:
vba
CopyEdit
Sub ClearComment()
Dim targetCell As Range
Set targetCell = Range("B5")
On Error Resume Next
targetCell.Comment.Delete ' Old style comments
targetCell.ClearComments ' New threaded comments
On Error GoTo 0
End Sub
I saved this in a .txt file and used Invoke VBA in UiPath, but I get the error:
Trust access to the VBA project object model must be enabled in Trust Center settings
I already enabled File → Options → Trust Center → Trust Center Settings → Macro Settings → Trust access to the VBA project object model, but the error still appears.
I think this could be due to organization group policies or macro restrictions.
please help with some else technique as i tried read cell and write cell to a different column of course that does the job but to a different cell not to the same cell
even if you do
read cell value
and write cell at the same column as “”
then again take the output of read cell value still the comment is there
i just need to delte the comment in a perticular cell how we can do it
Regards
Rahul

