Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 5 of 5

Using Virtual Earth/Maps Live + Mappoint

This is a discussion on Using Virtual Earth/Maps Live + Mappoint within the Bing Maps and MapPoint Web Service forums, part of the Map Forums category; I use Mappoint a lot for getting journey distances, and I automate it using VBA running from Excel. However for ...

  1. #1
    John.Sewell is offline Member Yellow Belt
    Join Date
    Oct 2007
    Posts
    42

    Using Virtual Earth/Maps Live + Mappoint

    I use Mappoint a lot for getting journey distances, and I automate it using VBA running from Excel. However for some locations - particularly China, Russia, and the Balkans - Mappoint doesn't have route info, but Virtual Earth/Maps Live does (much better than Google in fact).

    I have been trying to get the VBA code to call Virtual Earth, generate locations and a route and collect back the journey distance and time (though journey times look pretty crude). I don't need to see the map, I just want the return values.

    I can generate a HTML file that does the calling but I cannot find how to get the return values, and ideally I would do it as a URL. I think this must be something others have done...
    Any thoughts, advice or links? Anything welcomed.
    John

  2. #2
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Using Virtual Earth/Maps Live + Mappoint

    I have not done this, but I think it would make a good article. Perhaps we could collaborate on something?

    Eruc
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  3. #3
    John.Sewell is offline Member Yellow Belt
    Join Date
    Oct 2007
    Posts
    42

    Re: Using Virtual Earth/Maps Live + Mappoint

    Eric - I could sure due with a method at least. Maybe I can give a bit more on where I have got to (I realise this may be too much information).

    A VBA procedure puts up a form asking for the waypoints and creates the following HTML/Javascript file (modified from Microsoft example):

    (attached, simply change to .html from .txt)

    When that is done the file is then launched and shows a map and then generates the route in this case StPetersburg to Warsaw. Again I have lifted code from another web example...

    Code:
    Private Const SEE_MASK_NOCLOSEPROCESS = &H40
    Private Declare Function ShellExecuteEX Lib "shell32.dll" _
       Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long
    Declare Function GetSaveFileName Lib "comdlg32.dll" _
       Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Long
    ' VBShellExecute launches the file specified by the FPath parameter
    Public Sub VBShellExecute(FPath As String)
       Dim SEI As SHELLEXECUTEINFO
       Dim ans As String
     
       With SEI
         .cbSize = Len(SEI)
         .fMask = SEE_MASK_NOCLOSEPROCESS
         .hwnd = 0
         .lpVerb = "open"
         .lpFile = FPath
         .lpParameters = vbNullChar
         .lpDirectory = vbNullChar
         .nShow = 0
         .hInstApp = 0
         .lpIDList = 0
       End With
       Call ShellExecuteEX(SEI)
     
    End Sub
    So far so good
    What I really want to achieve from here is
    1) I want to be able to make the map and the IE call invisible
    2) I cannot see how I can get the journey distance & time returned back to the VBA procedure.
    3) I think there must be a more elegant way of doing the whole thing, with a relatively simple URL

    Any thoughts welcomed.
    Attached Files Attached Files

  4. #4
    trebormac is offline Junior Member White Belt
    Join Date
    Jan 2008
    Posts
    8

    Re: Using Virtual Earth/Maps Live + Mappoint

    John,

    I f you usinf Excel vba, see my post #2045, for the code for a function theat returns "trip duration". You can invoke this in excel and point to a cell (or) cells that contain addresses. I also have similar function for "driving distance".

    Hope this helps,

    Trebormac

  5. #5
    Tubrerose is offline Junior Member White Belt
    Join Date
    Oct 2008
    Posts
    1

    Re: Using Virtual Earth/Maps Live + Mappoint

    Hello

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Virtual Earth Powered Live Search Maps Expanding
    By VE For Government in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 12-13-2007, 12:40 PM
  2. Virtual Earth Update: New Live Search Maps Update
    By VE For Government in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 10-17-2007, 09:41 AM
  3. Paris, France is live in Virtual Earth!
    By EMEA Virtual Earth Blog in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 09-27-2007, 11:07 AM
  4. Ortho-photos de Paris live dans Virtual Earth !!!
    By EMEA Virtual Earth Blog in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 09-27-2007, 11:07 AM
  5. Live Meeting: Virtual Earth Madness
    By Eric Frost in forum Bing Maps and MapPoint Web Service
    Replies: 0
    Last Post: 02-24-2006, 07:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96