objExcel.Cells(5, 3).HorizontalAlignment=xlCenter
assuming that objExcel is a Worksheet object.
--
Ken Snell
<MS ACCESS MVP>
"kim" <(E-Mail Removed)> wrote in message
news:051c01c37c8d$16aceb50$(E-Mail Removed)...
> I'm coding a process in Access that will take the data in
> the database, manipulate it, and write a spreadsheet using
> automation. I would like to center the text of some cells
> on the spreadsheet, but I don't know how to do this. I
> assumed it would be "object.Alignment = 2" (w/o quotes),
> but that isn't working for me and I get a "Run-time
> error '438' Object doesn't support this property or
> method" message. The actual line of code is:
>
> objExcel.Cells(5, 3).Alignment = 2
>
> Any help anyone can provide me would be much appreciated.
>
>
> kim
>
>
|