Hi tinfanide,
It's because your 'Cells' references don't point to the 'sheet'.
BTW, it's not good practice to use names like 'sheet', as you can very quickly get that messed up with '.Sheet'. Furthermore, I see you're still trying to select things. You rarely need to select anything. For example:
Code:
Sub Test()
Dim xlWkBk As Workbook
Dim xlSht As Worksheet
Set xlWkBk = Workbooks("test.xls")
Set xlSht = xlWkBk.Worksheets("Sheet1")
With xlSht
'do something, eg define a range to work on:
With .Range(.Cells(23, 2), .Cells(47, 2))
'do something, eg populate the defined range:
.Value = Now
End With
End With
Set xlSht = Nothing: Set xlWkBk = Nothing
End Sub
PS: Your question concerns Excel vba, but you posted it in the Word vba forum. I've moved it to the Excel forum.