john453
08-06-2011, 06:16 PM
Dear all:
I am going crazy about the code as to how to add pushpins in the Mappoint Map. The code is written in VBA(Mappoint embedded in EXCEL).
The whole code is displayed as follows:
Private Sub Add_Pushpins_Click()
Dim objApp As MapPoint.Application
Dim objLoc As MapPoint.FindResults
Set objApp = CreateObject("MapPoint.Application.EU.16")
objApp.Visible = True
Set objLoc = objApp.ActiveMap.FindAddressResults(, , , , "CV4 7AL", geoCountryUnitedKingdom)
objApp.ActiveMap.AddPushpin objLoc, "Added Pushpin"
End Sub
I checked my code for a couple of times, but it is still not working. The system keep sending message" Type mismatch" for the code : "objApp.ActiveMap.AddPushpin objLoc, "Added Pushpin" "
I am really going crazy about this and I cannot figure out exactly which part went wrong .The whole program is in the attached file. Can everyone helpe me out ? I cannot thank you enough!
I am going crazy about the code as to how to add pushpins in the Mappoint Map. The code is written in VBA(Mappoint embedded in EXCEL).
The whole code is displayed as follows:
Private Sub Add_Pushpins_Click()
Dim objApp As MapPoint.Application
Dim objLoc As MapPoint.FindResults
Set objApp = CreateObject("MapPoint.Application.EU.16")
objApp.Visible = True
Set objLoc = objApp.ActiveMap.FindAddressResults(, , , , "CV4 7AL", geoCountryUnitedKingdom)
objApp.ActiveMap.AddPushpin objLoc, "Added Pushpin"
End Sub
I checked my code for a couple of times, but it is still not working. The system keep sending message" Type mismatch" for the code : "objApp.ActiveMap.AddPushpin objLoc, "Added Pushpin" "
I am really going crazy about this and I cannot figure out exactly which part went wrong .The whole program is in the attached file. Can everyone helpe me out ? I cannot thank you enough!