Thread: Excel and VB6
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Phil Phil is offline
external usenet poster
 
Posts: 6
Default Excel and VB6

Hello world of experts,

I know this is no VB6 newsgroup, but I bet you can help on this:.

I am trying from VB6 to access an Excel object and am filling okay a
spreadsheet. The only thing I cannot do is to left justify all spreadsheet
data at the end of my shovelling experience (-;

I am doing something like :

dim xlapp as object
xlapp = CreateObject("Excel.Application")
....
....

at the end I'd like to do (as I would do with Excel) :

xlapp.Cells.Select
With Selection
.HorizontalAlignment = xlLeft
End With

but I keep getting an error message saying that applying HorizontalAlignment
cannot be done on the object...
I certainly do something wrong but I can't see it...

Any hint?

Thanks a lot

Phil