Add Comment to Cell in Worksheet!

Hi, thanks for all this Aspose awesome products.

I’m having problems when adding comments to some cell in a worksheet (using Swift & AsposeCell pod). I read all the doc and google a loot with no result.

Currently I complete the fallowing task’s.

  • Configure platform with ClientId & ClientSecret
  • Auth with Aspose Cloud Service (getting auth token etc.)
  • Create a new workbook in the cloud (named test.xlsx)
  • Add four cells with value (valueType: int, value: 100) from A1 to D1
  • Add one cell with formula at A2 (=Sum(A1,B1,C1,D1)) and getting in A2 the excepted result (400 in this case)
  • Renamed default worksheet from “Sheet1” to “Start”
  • Add another worksheet (named “Other data”)
  • I’m downloading the file to local file storage & viewing with Microsoft Excel (for MacOS) and is fine (no errors of any type).

I ve created a wrapper with a loot of functions I’m using (I will share this with community when finished) but I have problems with the cellsWorksheetsPostWorksheetComment function. Currently I run this code:

    // Swift code
    let link = Link(href: "/\(self.fileName)/worksheets/\(self.worksheetName)/comments/A2", type: nil, rel: "self", title: nil)
    let comment = Comment(link: link, autoSize: true, author: "Wo_0NDeR", isVisible: true, textOrientationType: "NoRotation", height: 10, note: "This is a note from Wo_0NDeR", width: 10, textVerticalAlignment: "Top", cellName: "A2", htmlNote: "This is a note from Wo_0NDeR", textHorizontalAlignment: "Left")

    CellsAPI.cellsWorksheetsPostWorksheetComment(name: self.fileName, sheetName: self.worksheetName, cellName: "A2", comment: comment) { data, error in
        print(data)
        print(error)
    }

but I’m receiving this error from aspose cell cloud API:

error(400, Optional(264 bytes), Alamofire.AFError.responseValidationFailed(reason: Alamofire.AFError.ResponseValidationFailureReason.unacceptableStatusCode(code: 400)))

And from the Api Usage Section in Dashboard I see this log:

Method Name: PostWorksheetComment
Product: Aspose.Cells
API Version: v3.0
Details: Error: PostWorksheetComment. Exception: PostWorkSheetComment fails. (Object reference not set to an instance of an object.).

This is a link of a picture of the file opened by Excel App: File Opened with Excel App

Some help with this this would be appreciated. Thanks in Advance !

This topic has been moved to the related forum: Add Comment to Cell in Worksheet! - Free Support Forum - aspose.cloud