P
Pendragon
Access03/WinXP
I have data being written to an Excel Workbook template and through loops am
moving to specific cells in the template. I don't have any issue writing
data into the cells; however, I have not been able to figure out how to
format the cell.
With .Activesheet
.Range(stCell).Offset(0, icolumn).Value = CName
.Range(stCell).Offset(0, icolumn).Select
With Selection
.HorizontalAlignment = xlcenter
.Font.Bold = True
End With
End With
'CName' is a string variable. The first two lines work; "Object Required"
is the error message received when the code hits the horizontal alignment
line.
Any help appreciated. Also, any websites with some thorough shop talk on
controlling/formatting Excel from Access? I have not been able to find much.
Thanks!
I have data being written to an Excel Workbook template and through loops am
moving to specific cells in the template. I don't have any issue writing
data into the cells; however, I have not been able to figure out how to
format the cell.
With .Activesheet
.Range(stCell).Offset(0, icolumn).Value = CName
.Range(stCell).Offset(0, icolumn).Select
With Selection
.HorizontalAlignment = xlcenter
.Font.Bold = True
End With
End With
'CName' is a string variable. The first two lines work; "Object Required"
is the error message received when the code hits the horizontal alignment
line.
Any help appreciated. Also, any websites with some thorough shop talk on
controlling/formatting Excel from Access? I have not been able to find much.
Thanks!