Code is being missed during the run

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
 
K

Ken Snell

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.
 
O

Owen

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

Owen
 

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