[AccessD] Quick VBA question - Selecting Cell In Excel

John Skolits askolits at ot.com
Tue Jun 19 17:36:12 CDT 2007


This has to be a no brainer.

Using VBA I just want to select an Excel sheet and select a cell.

Set objXLBook = GetObject("c:\test.xls")


I can make the correct sheet active by using:

objXLBook.Sheets("Sheet2").Select


but then can't select the cell. I tried

objXLBook.Range(.Cells(1, 2)).Select
or 
objXLBook.Range("B1").Select

What's the correct syntax?
The error I get is 
"Object doesn't support this property or method"

Maybe I shouldn't be using the "Range" reference?

John Skolits







More information about the AccessD mailing list