Invalid pointer error -2147467261

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

The code below gets to the ErrorHandler: label but generates an "invalid
pointer" error (-2147467261) when attempting to Resume Next.

Here is a trimmed-down version of the germane code:

MapPoint-related objects previously dimensioned above here...

On Error GoTo ErrorHandler
Dim AddressFound as Boolean
AddressFound = True
'create pushpin in MapPoint
MPApp.ActiveMap.AddPushpin AddressLocation, WaypointName
If Not AddressFound, blah, blah, blah
End If
Exit Sub

ErrorHandler:
Select Case Err.Number
Case -2147217383 'correctly gets here on address not found
AddressFound = False
Resume Next
End Select
 
It was my own fault, and it was in the line of code just above the one I
posted, so it was a bad question. I was trying to handle the error on the
placement of hte point on the map, one line AFTER the actual failure, which
was in attempting to locate the point before it could place the object there.
 
Back
Top