18
Views
0
Comments
[Advanced Excel] Cell Vertical Alignment not working
Question
Forge component by Carlos Freitas
68
Published on 27 Aug 2019

When I set the CellFormat.VerticalAlignment to 0 the documentation implies that the vertical alignment of the cell will be set to Top. This does not work. The problem lies in the extensions ApplyFormatToRange method. The line "if (format.ssSTCellFormat.ssVerticalAlignment > 0)" should be testing for greater than or equal 0 e.g. "if (format.ssSTCellFormat.ssVerticalAlignment >= 0)". Making this change fixes the problem. 

I think there are also other tests in that method e.g. for ssHorizontalAlignment which should be changed in the same way.

Regards,

Nick