From f2df344739146189a1dea7cfb81239231af5135b Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 15 Apr 2019 11:22:57 +0800 Subject: Resolve #369,#370 add error return value exported functions: GetMergeCells ProtectSheet UnprotectSheet UpdateLinkedValue GetMergeCells SetSheetVisible inner functions: workSheetReader copySheet --- comment.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'comment.go') diff --git a/comment.go b/comment.go index ca79779..ed3d4a7 100644 --- a/comment.go +++ b/comment.go @@ -80,7 +80,10 @@ func (f *File) AddComment(sheet, cell, format string) error { return err } // Read sheet data. - xlsx := f.workSheetReader(sheet) + xlsx, err := f.workSheetReader(sheet) + if err != nil { + return err + } commentID := f.countComments() + 1 drawingVML := "xl/drawings/vmlDrawing" + strconv.Itoa(commentID) + ".vml" sheetRelationshipsComments := "../comments" + strconv.Itoa(commentID) + ".xml" -- cgit v1.2.1