Migrating code from v4

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
jleg
Posts: 11
Joined: Thu Apr 04, 2013 12:04 pm
Location: France

Migrating code from v4

Post by jleg »

Hello Lars,

As you tell me, i've finally made a new registration. Thanks for your attention.
I'm trying to migrate code from v4 to v5 and i've some difficulties because many changes have been made in the component code. The few indications done in the changes.txt file are not enough to migrate.

Is there an exhaustive document describing how to migrate code from v4 ?

If not, what are the new names of the following v4 units ?
1. XLSFonts4
2. CellFormats4
3. Cell4

How can i replace these statements ?
4. XLS.Sheets.DrawingObjects.Pictures.Clear
by XLS.Sheets.Drawing.BIFFDrawing.Pictures.Clear
or just by XLS.Sheets.Drawing.Clear

5. XLS.formats[0].NumberFormat := 'dd/mm/yyyy';
by XLS.CmdFormat.Number.Format := 'dd/mm/yyyy'; ?

6. What is the corresponding value for "ctNotUsed" in the "TXLSCellType" type ?

7. XLS.Sheets.Columns.AddIfNone(n, 1); ? because AddIfNone is deprecated

8. XLS.FileName := 'file_path';
XLS.Read;
XLS.Sheets[0].LastCol := 4; <= ReadOnly now
XLS.Sheets[0].LastRow := 50000; <= ReadOnly now

thanks for your help.
jleg
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Migrating code from v4

Post by larsa »

Hello

1. TXc12Font

2. Use XLS.CmdFormat when formatting cells. See sample.

3. Same as above.

4,5 Yes.

6. xctNone

7. AddIfNone is not required anymore. The method is now empty and just kept for backward compability.

8. Use CalcDimensions
Lars Arvidsson, Axolot Data
jleg
Posts: 11
Joined: Thu Apr 04, 2013 12:04 pm
Location: France

Re: Migrating code from v4

Post by jleg »

Hello,

For my 4th question, you answered "Yes" but there were 2 solutions, what is the good one :

4. How to replace

Code: Select all

XLS.Sheets[i].DrawingObjects.Pictures.Clear
by

Code: Select all

XLS.Sheets[i].Drawing.BIFFDrawing.Pictures.Clear
or just by

Code: Select all

XLS.Sheets[i].Drawing.Clear
jleg
Post Reply