don't ask me why, but i think it has something to do with using the pApp.zoomwindow function inside a Using block.
try this code, its the same thing but with the zoomwindow method moved to the end of the sub, it works for me
Private Sub ZoomObject(ByVal TargetID As ObjectId)
Dim editor As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Dim ptll As Point3d
Dim ptur As Point3d
Dim pApp As Autodesk.AutoCAD.Interop.AcadApplication
pApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
Using db As Database = Application.DocumentManager.MdiActiveDocument.Database
Using trans As Transaction = db.TransactionManager.StartTransaction
Using btr As BlockTableRecord = trans.GetObject(db.CurrentSpaceId, OpenMode.ForWrite, False)
Dim zoomobj As Autodesk.AutoCAD.DatabaseServices.Entity = trans.GetObject(TargetID, OpenMode.ForRead)
Dim zoomext As Extents3d = zoomobj.GeomExtents
ptll = zoomext.MinPoint
ptur = zoomext.MaxPoint
'Write the points to the command line for debugging purposes
editor.WriteMessage(vbNewLine & "LL Corner " & ptll.ToString)
editor.WriteMessage(vbNewLine & "UR Corner " & ptur.ToString)
End Using
End Using
End Using
pApp.ZoomWindow(ptll.ToArray(), ptur.ToArray())
pApp = Nothing
End Sub