Maty
11-17-2011, 07:28 AM
Hi everyone,
I have a strange problem with placecategories here.
I am using VBA (ecel 2010) and have a list of Airports (three letter IATA Codes). I want to determine longitude and latitude values of these airports. For that i use the FindPlaceResults Method which hands me a location object. I then check whether that Locationobject has the correct PlaceCategory.index if it has one at all. If it has i save the long/lat attributes (if not i check for the next result).
This worked very nicely in the NA version of mappoint. But when I tried it in the EU version, there was simply PlaceCategory=nothing in my resulting-location object even though if I search in the desktop application of Mappoint EU it seems to be categorized. I dont really know what the problem is here..
Sample code in VBA:
Dim oApp As MapPoint.Application
Dim oMap As MapPoint.Map
Dim oLoc As MapPoint.Location
Set oApp = New MapPoint.Application
With oApp
.Visible = True
.UserControl = True
End With
Set oMap = oApp.ActiveMap
Set oLoc = oMap.FindPlaceResults("TXL")(1) 'this is Tegel Airport Berlin
Debug.Print "Cat TXL: " & oLoc.PlaceCategory.Index
The object looks like this. PlaceCategory = nothing
http://www.koliweb.de/obj.png
http://www.koliweb.de/cat.pngBut if I check for "TXL" in the Mappoint application there seems to be a category for it..
edit: sorry for the pictures in German, 'Flughafen' = Airport, 'Falsch' = false
I have a strange problem with placecategories here.
I am using VBA (ecel 2010) and have a list of Airports (three letter IATA Codes). I want to determine longitude and latitude values of these airports. For that i use the FindPlaceResults Method which hands me a location object. I then check whether that Locationobject has the correct PlaceCategory.index if it has one at all. If it has i save the long/lat attributes (if not i check for the next result).
This worked very nicely in the NA version of mappoint. But when I tried it in the EU version, there was simply PlaceCategory=nothing in my resulting-location object even though if I search in the desktop application of Mappoint EU it seems to be categorized. I dont really know what the problem is here..
Sample code in VBA:
Dim oApp As MapPoint.Application
Dim oMap As MapPoint.Map
Dim oLoc As MapPoint.Location
Set oApp = New MapPoint.Application
With oApp
.Visible = True
.UserControl = True
End With
Set oMap = oApp.ActiveMap
Set oLoc = oMap.FindPlaceResults("TXL")(1) 'this is Tegel Airport Berlin
Debug.Print "Cat TXL: " & oLoc.PlaceCategory.Index
The object looks like this. PlaceCategory = nothing
http://www.koliweb.de/obj.png
http://www.koliweb.de/cat.pngBut if I check for "TXL" in the Mappoint application there seems to be a category for it..
edit: sorry for the pictures in German, 'Flughafen' = Airport, 'Falsch' = false