Notes in Excel2007

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
Roman55
Posts: 10
Joined: Tue Mar 26, 2013 11:29 am

Notes in Excel2007

Post by Roman55 »

Hello

Please provide an example to add note to a cell. For Excel97, the following code works:

Code: Select all

  Result := xlsRW[0].Drawing.BIFFDrawing.Notes.Add;
  Result.Text := text;
BIFFDrawing is nil for Excel2007 mode, so I can't use it. Samples directory has an example called "Comment" that works for Excel2007:

Code: Select all

XLS[0].Comments.Add(1,4,'Hello,world')
but when I change version to Excel97, there are no commented cells in output file at all.

What is the correct way? Is there a proper code for both writing modes?

Tested on version 5.10.16.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Notes in Excel2007

Post by larsa »

Hello

You have to choose method depending on which excel version you want to create notes for. This will be fixed in a later update.
Lars Arvidsson, Axolot Data
Post Reply