我想讀取Excel表格中的註釋,但無法做到這一點。請幫忙。提前致謝。我的代碼如下 -如何閱讀Excel中的Excel表單的評論#
Excel.Application appExl;
Excel.Workbook workbook;
Excel.Worksheet NwSheet;
Excel.Range ShtRange;
appExl = new Excel.Application();
workbook = appExl.Workbooks.Open(Server.MapPath("~/" + System.Configuration.ConfigurationManager.AppSettings["ExcelFile"] + fileName), Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
NwSheet = (Excel.Worksheet)workbook.Sheets.get_Item(1);
string obj = NwSheet.Range[0].Comment.Text;
乍一看,我會說0不是有效範圍。這不應該是Excel工作表中的有效範圍,例如A6? –
好吧......當然......但我仍然無法將該評論存儲在任何變量中。它給我錯誤 – Priyanka