Activeworkbook.range ---> Not supported by VBScript?

S

Shetty

Hi all,
I have a small script running at each startup and shutdown.
At the runtime, it gives error that ---> Object doesn't support this property or
method; 'Activeworkbook.range' <---
Any Help is appreciated.
Regards,
Shetty.

So far I have the following.

Dim objXL
Dim objWkB
Dim i
Dim Dr

Set objXL = wscript.CreateObject("Excel.Application")
objXL.Visible = False
Set objWkB = objXL.WorkBooks.Open("c:\123\time.xls")

objXL.activeworkbook.Range("A65536").End(xlUp).Offset(1, 0).select
objXL.activeworkbook.ActiveCell.Value = Date
objXL.activeworkbook.ActiveCell.Offset(0, 1).Value = Time

objXL.activeworkbook.save
objXL.activeworkbook.Close' Close WorkBook
objXL.Visible = True
objXL.Quit 'Quit Excel
 
P

papou

Hi Shetty
Range is a property attached to an Excel sheet and not to a workbook.
So you may change with
objWkB.Worksheets("Sheet1").Range '....

HTH
Cordially
Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top