Community of VE/MapPoint Users and Developers
This is a discussion on Help W Excel Mappoint VBA within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I'm a new developer to MP, and only OK w/VBA in excel. I'm trying to write an Excel UDF that ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Help W Excel Mappoint VBA http://www.dailydoseofexcel.com/inde...tions/&paged=2 (scroll down) I'm having trouble with getting the FindAddressResults method to work, though I can make FindResults work fine. I've beed so fristrated getting this to work, that I've abandon the UDF and am working with a simple plotting script from somewhere on the web. When I run it, I get the following message: "the parameter is incorrect" Here's my code: Code: Private Sub mapit()
Dim oApp As MapPoint.Application
Dim Objloc As MapPoint.FindResults
Set oApp = CreateObject("MapPoint.Application.NA.11")
oApp.Visible = True
Set oBJMap = oApp.NewMap
'From online instructions: object.FindAddressResults([Street], [City],_
'[OtherCity], [Region], [PostalCode], [Country])
'*************
'Samples coppied from MS website
'*** Set objLoc = objMap.FindAddressResults("1 Microsoft Way", "Redmond", "WA")(1)
'****Set objloc = objApp.ActiveMap.FindAddressResults("One Microsoft Way", "Redmond", , "WA
'******
'My code that doesn't work -- I get "the parameter is incorrect" error
Set Objloc = oBJMap.FindAddressResults("4724 Main Street", "Downers Grove", "IL")(1)
'******************
oBJMap.AddPushpin Objloc, "NAME"
objMap.DataSets.ZoomTo
Please help. |
| |||
|
Hi, FindAddressResults need 6 arguments, where some of them may be an empty string: Code: FindAddressResults(street, city, othercity, region, zip, country); BTW: What is the meaning of the extra parentesis '(1)' ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
So I have tried it every logical way, ut it doesn't work for me. The code you see above is taken right from the MS website, but I can't make it work. I've tried the 6 arguments suggested and every other logical combination. Obviously I'm doing somthething wrong, but my code looks to me exactly like the code from the MS website. Very frustrating. Help. EW |
| |||
|
Hi Eric, Ok I do not know VB, but if the second parentasis is telling to use the first item in the collection, what happens if this item is NULL? Could that give an error ? Just do some guessing of course ...
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Still Frustrated
Eric, Thanks for the post. Happy to buy the beer if you can help me solve this problem. I couldn't find FindAddressResults in Mappoint's Help, and I actually did go to through all of the web tutorials. In fact, when I cut and paste the code from the tutorials to Excel VBA, the ones with FindAddressResults fail to work. As I menioned above, FindResults seems to work for me. There is somethig with the syntax in FindAddressResults that I'm missing and it's driving me nuts. Please help. Cheers, Eric |
| ||||
|
Did you try the example from the Help file? Sub FindAddressSearch() Dim objApp As New MapPoint.Application Dim objFindResults As MapPoint.FindResults 'Set up application objApp.Visible = True objApp.UserControl = True 'Output first result of find search Set objFindResults = objApp.ActiveMap.FindAddressResults("One Microsoft Way", "Redmond", , "WA", , geoCountryUnitedStates) MsgBox "The first item in the find list is: " _ + objFindResults.Item(1).Name End Sub
__________________ |
| |||
| Example From Help fails
I cut and paste your example directly into the Excel VBA and run the app. Mappoint kicks off and shows a map of the USA, but then the VBA gets an error "Cannot parse an addresssin the specified country". I tried substituting "United States", 244, and leaving hte country blank. No joy. Help! Cheers, Eric |
![]() |
| Tags |
| excel, mappoint, vba |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mappoint and excel | mike_v | MapPoint 2006/2009 Discussion | 0 | 05-30-2006 02:35 PM |
| Excel & MapPoint | Dingo1 | MapPoint 2006/2009 Discussion | 5 | 12-12-2005 07:14 PM |
| Excel and MapPoint | Eric Frost | MapPoint 2006/2009 Discussion | 0 | 05-09-2005 09:01 PM |
| Mappoint & Excel | Anonymous | MapPoint 2006/2009 Discussion | 0 | 10-27-2004 03:38 AM |
| MPControl embedded in excel - excel loses functionality | ruyasan | MapPoint 2006/2009 Discussion | 2 | 05-20-2004 03:41 AM |
Ski Breaks
Book ski breaks to a range of great ski destinations online at Holiday Hypermarket. It is quick, easy and best of all, fantast value.
Business Travel Agent
Leading Business Travel Agent. Personal service is at the heart of our business. Talk to one of our travel agents today.
Cheap Holiday Turkey
Booking a cheap holiday to Turkey doesn't have to be at the expense of enjoyment. Dealchecker.co.uk searches holidays from the leading UK Tour Operators.
Nile Cruises
Nile cruises are one of the best ways to discover the riches of Egypt. See ancient ruins and lush verdure from the River Nile. Book today!
Cheap Egypt Holidays
Pick up a bargain cheap Egypt holiday online when you visit ulookubook.com. Just check out our tips to make sure you book at the right time to get a great holiday for a great price. Finding cheap Egypt holidays can be simple when you know how.
Family package holidays
Save a lot of time and opt for one of the great family package holidays at Travel.co.uk
Cheap Holidays in Gran Canaria
Would you like to visit the Canary Islands, but you're on a budget? Get information on cheap holidays in Gran Canaria at On The Beach.