View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CDM CDM is offline
external usenet poster
 
Posts: 2
Default Select method failing

I'm trying to remove a header row in a different spreadsheet with the
following code. Everything goes OK until it gets to .Range("A1").select. It
gives me an error message that says, "Select method of Range class failed."
What am I missing?

Dim objWkBook As Object
Dim objWkSheet As Object

Set objWkBook = GetObject("Z:\AgingByLocation.xls")
Set objWkSheet = objWkBook.Worksheets(1)
With objWkSheet
.Activate
.Rows(1).Delete Shift:=xlUp
.Range("A1").Select
End With