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
|