Problem opening map

mapenthuse
02-28-2008, 11:25 AM
We are having trouble opening our Map Point map from a Word module. when it runs, it opens Map point but not our map. Without the last two lines we get an open Map POint application. When we manually close that we get a debug error on the line that opens our file. With the last two lines (the ones with "nothing"), we just get a blank screen (I assumed the MP program was just open and closed).

Here is our code:

Public Sub OpenDS1()
Dim objApp As New MapPoint.Application
objApp.Visible = True
objApp.UserControl = True
objApp.OpenMap objApp.Path + "C:\Documents and Settings\Gary Willick\My Documents\GPS-GIS\wsstores12.17.06.ptm"



Set objMap = Nothing
Set objApp = Nothing
End Sub



Thank you,

Gary

Eric Frost
02-28-2008, 01:41 PM
I made a couple changes, try this code:

Public Sub OpenDS1()
Dim objApp As New MapPoint.Application
objApp.Visible = True
objApp.UserControl = True
objApp.OpenMap "C:\Documents and Settings\Gary Willick\My Documents\GPS-GIS\wsstores12.17.06.ptm"

End Sub

:17m:

mapenthuse
03-05-2008, 12:31 PM
Eric - Thanks - it worked! on to the next phase.

I will be searching for all stores in a given zip code. Do I have to loop through the entire data set, find all those with the desired zip, and put each one in a push pin set? I then want a route calculated that hops from one store to the next, starting from my source address. Can map POint calculate the best order for this route, or is it done in the order they were found? If the latter, is there some way for me to view the found set of push pins and set an order before driving directions are actually calculated?

GAry

Eric Frost
03-06-2008, 08:14 AM
Good! thanks for following up.

Good luck with the next phases. If you get stuck on any part, feel free to pop in here and show the code and it would probably help to post your ptm and any other information.

Try to keep it to one question per post, I'll take a stab at answering your questions now.

I will be searching for all stores in a given zip code. Do I have to loop through the entire data set, find all those with the desired zip, and put each one in a push pin set?

It might be easier to export them all using a right-click "Export to Excel" and then look in the Excel spreadsheet.

I then want a route calculated that hops from one store to the next, starting from my source address. Can map POint calculate the best order for this route, or is it done in the order they were found?

Yes! see the Help File in the Optimize method.

If the latter, is there some way for me to view the found set of push pins and set an order before driving directions are actually calculated?

How do you want to view them? Maybe have a step that dumps them out to Excel and then re-imports after you make adjustments?

Eric

mapenthuse
03-06-2008, 08:33 AM
I don't need to export to Excel if teh data was originally there. I can just query excel, import into MP, then have MP calculate the route. I will look at teh optimize function in Help.

I assume I can do all this in code?

GAry

Eric Frost
03-06-2008, 08:57 AM
I think it can all be done in code..

:Mr-T:

Eric

 
Web mp2kmag.com
mapforums.com