I\'ve been trying to align Excel cell text values. I\'ve tried the more common xlLeft
, xlRight
but this doesn\'t seem to work. The error was xlLe
You can use xlLeft:
Imports Microsoft.Office.Interop.Excel
...
oSheet.Range("A1").HorizontalAlignment = Constants.xlLeft
For VerticalAlignment
:
Top: -4160
Center: -4108
Bottom: -4107
And HorizontalAlignment
:
Left: -4131
Center: -4108
Right: -4152
xcl.Range("J:J").EntireColumn.HorizontalAlignment = _
Microsoft.Office.Interop.Excel.Constants.xlCenter