Code is being missed during the run

  • Thread starter Thread starter Owen
  • Start date Start date
O

Owen

I am try to delete a row in Excel from Access
However when it reaches that piece of code it jumps out of
the function back to the sub it was called from.

Set oExcel = GetObject(, "Excel.Application")
With oExcel
Sheets("Prodmans Training Grid").Select

Gets to here then jumps

ActiveSheet.Delete xlUp

If Range("B3").Value = 0 Then Exit Do

Loop
End With
 
Did you leave off the . character in front of each of the rows under the
With oExcel? You need them if the code is going to know that you're using a
method or collection or property of oExcel.

Do you have error handling in the sub that is calling this code snippet? The
code likely is erroring on the offending line and is returning to the
calling sub to use its error handler.

Is the ActiveSheet the only sheet in the workbook?

More info needed.
 
Thanx I HAd mised out the . character. Somedays you cant
see the wood for the trees

Owen
 
Back
Top