///////////////
Dim objexcel
Set objExcel = createobject("Excel.application")
objexcel.Visible = True
objexcel.Workbooks.open ("C:\kena.xls")
objexcel.Sheets("Data").Range("a65536").End(XlDirection.xlUp).Offset(1,
0).Select 'this is the problem line
objexcel.ActiveCell.Value = "Testing"
objexcel.ActiveCell.offset(1,0)= "Fun"
objexcel.ActiveWorkbook.Save
objexcel.Quit
Everything is fine except the line that tries to find the first free line in
the "a" column of the worksheet. It has a real problem with the End method.
Normally in VBA, you can just say ..End(xlUp), but that doesn't work in
vbscript. So i tried XlDirection.xlUp (the error message was "object required
XlDirection") and also objExcel.XlDirection.xlUp (the error message is
"Object doesn't support this property or method")
If I take out the end method from the line everything works fine, so it
seems like vbscript just can't figure out what I mean when I say, xlUp. Like
I need to refer to a different object or library or something.
Thanks
Are your "xl" prefixed items defined as constants?
Also see:
http://www.xtremevbtalk.com/archive/index.php/t-259299.html
Thanks.