Flexcel get format from a cell

Hi,

I want to get all format from a column and insert in a new one.
I use this syntax :
FlexCelImport1.InsertAndCopyRange(TXlsCellRange.Create(17, 6, 17, 6), 17, 6, 1, TFlxInsertMode.ShiftColRight, TRangeCopyMode.All, FlexCelImport1, FlexCelImport1.ActiveSheet);

I insert a new column on the right from column 6 but I don't have the format (no border, no bold, etc.)
In Column 6, I have borders, bold, etc.

Any idea

Thanks

Joel

Hi,
Why are you copying to row 17?

FlexCelImport1.InsertAndCopyRange(TXlsCellRange.Create(17, 6, 17, 6), 17, 6, 1, ...

The first 2 "17" don't really matter, as you are copying the full column (because you use TFlxInsertMode.ShiftColRight), the row from where you start copying isn't important: All rows will be copied. But the third 17 (the one I marked in red above) means that the row will be copied starting at row 17. So if you have this file:


And you copy run the code you posted on it, you'll get:



To make this work as expected, you would need to do:

FlexCelImport1.InsertAndCopyRange(TXlsCellRange.Create(1, 6, 1, 6), 1, 6, 1, TFlxInsertMode.ShiftColRight, TRangeCopyMode.All, FlexCelImport1, FlexCelImport1.ActiveSheet);

Where the important thing is the number in red. I also changed the 17 in TXlsCellRange.Create because even when they don't matter, they are confusing because why are you selecting the 17th row?

Note that the code above will insert a new column with the values of the old (so the "hello" text is copied too in the image above). If you want to just copy the formats, you can use TRangeCopyMode.Formats instead of TRangeCopyMode.All. 

Thanks for the information.
17 is just a mistake.
Thanks