View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Binzelli[_2_] Binzelli[_2_] is offline
external usenet poster
 
Posts: 1
Default Unexpected Internal error when calling a function (Excel/MapPoint)

Hi !

I am having an inconsistent problem calling a function from Exce
(2000) VBA, while working with the Microsoft Mappoint Object Model.
have posted this question in the Mappoint forum as well, but so fa
noone has been able to help me out and I am posting here because
think the problem might not be specifically related to MapPoint, but t
(Excel) VBA in general.

In my code I am using a method called "CallMatchMethod". This metho
calls a function (in the code below the function called "MatchFirst"
when MapPoint cannot match geographical data in the recordset.

The strange thing is that this works regularly without any problems
but from time calling the function generates an error "Unexpecte
internal error (4000)". When debugging I see that the code neve
actually 'reaches' the function and generates the internal error.

This is the code I use (in a form). Below that is the Function bein
called. objRS is a recordset where several records are unmatche
(objRS.IsMatched < True).

MAIN CODE


Code
-------------------

Do While Not objRS.EOF 'Loop through recordset
If objRS.IsMatched < True Then 'When record can't be matched
objRS.CallMatchMethod "MatchFirst", Me
End If
objRS.MoveNext
Loop

-------------------

FUNCTION

Code
-------------------

Public Function MatchFirst(Name As String, _
Results As FindResults) _
As Long

MatchFirst = 1

End Function

-------------------


Can someone help ?

Thanks

--
Message posted from http://www.ExcelForum.com