I have an access module that opens an excel spreadsheet and writes informtion to it. I need to set the alignment on some cells so that they are right aligned(some will also be centered).
When I use the example below and it hits the horizontalalignment property I get 'runtime error 1004 unable to set the Horizontalalignement of the range class.'
Does anyone have any ideas how this can be done?
With Sheet.cells(j, i + 1)
.HorizontalAlignment = xlRight
.VerticalAlignment = xlbottom
.WrapText = False
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
When I use the example below and it hits the horizontalalignment property I get 'runtime error 1004 unable to set the Horizontalalignement of the range class.'
Does anyone have any ideas how this can be done?
With Sheet.cells(j, i + 1)
.HorizontalAlignment = xlRight
.VerticalAlignment = xlbottom
.WrapText = False
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With