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

Hi,

Firstly, you need

Set xlapp = CreateObject("Excel.Application")


I do...

and have you set a reference to Excel in you VB6 project, openened a
wokbook, activated a sheet? I would use

dim xlapp as object
dim xlWb as object
dim xlWs as obejct

Set xlapp = CreateObject("Excel.Application")

Set xlWb = xlapp/Workbooks.Open(Filename:="c:\myBook.xls")


I am creating it on the fly, so I do not open one. I just create one and
fill in the sheets...All sheets are filled anyway...

Set xlWs = xlWb.Activesheet
With xlws
.HorizontalAlignment = xlLeft
End With


The message I get is: "This object doesn't handle this property of
method"...when getting to the .HorizontalAlignment line

Thanks