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
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Developing with MapPoint and Excel - Getting Started

This is a discussion on Developing with MapPoint and Excel - Getting Started within the MP2K Magazine Articles forums, part of the Map Forums category; Developing with MapPoint and Excel - Getting Started This thread refers to a mini-tutorial in the latest MP2Kmag Newsletter. Subscribe ...

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

    Developing with MapPoint and Excel - Getting Started

    Developing with MapPoint and Excel - Getting Started

    This thread refers to a mini-tutorial in the latest MP2Kmag Newsletter. Subscribe by sending an e-mail to newsletter-subscribe@mp2kmag.com.

    "Excel is an easy to use black board or sandbox for playing with MapPoint automation/programming and in tandem with output from MapPoint can be a powerful platform for all sorts of geospatial analysis. Perhaps the hardest part for beginners is figuring out where to begin. In this example I will outline the steps involved in setting up a basic macro for launching MapPoint."

    Read the mini-tutorial here:
    http://www.mp2kmag.com/update/mappoi.../#features_sec

    Click Post Reply to post a question or comment.

  2. #2
    afryan is offline Junior Member White Belt
    Join Date
    Nov 2003
    Posts
    1

    Selecting text boxes

    I am interested in seeing examples of controlling MapPoint through Excel, this promises to be an interesting topic.

    I was recently had a set of maps that had been created that used text boxes as labels for multiple locations on each map. I wanted to use VB in Excel to select all text boxes on the map and set the border to 1 pt. I'd be curious to see how that is done. Thanks.

  3. #3
    paul howard is offline Junior Member White Belt
    Join Date
    Nov 2007
    Posts
    1

    Red face Re: Developing with MapPoint and Excel - Getting Started

    [quote=Eric Frost;8103]Developing with MapPoint and Excel - Getting Started

    This thread refers to a mini-tutorial in the latest MP2Kmag Newsletter. Subscribe by sending an e-mail to newsletter-subscribe@mp2kmag.com.

    "Excel is an easy to use black board or sandbox for playing with MapPoint automation/programming and in tandem with output from MapPoint can be a powerful platform for all sorts of geospatial analysis. Perhaps the hardest part for beginners is figuring out where to begin. In this example I will outline the steps involved in setting up a basic macro for launching MapPoint."

    Read the mini-tutorial here:
    What's New at MP2K Magazine - The Magazine for MapPoint

    New starter

    I have Mappiont 2004 Europe and I am trying to follow yout first tutorial but when running the Macro I have the message ActiveX component can't create object . I am sure it is due to the Set oApp line of the script.

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

    Re: Developing with MapPoint and Excel - Getting Started

    Yes, change the NA in this line to EU

    Set oApp = CreateObject("MapPoint.Application.NA.11")

    Or better yet, try ommitting the entire .NA.11 part and just do this

    Set oApp = CreateObject("MapPoint.Application")

    hope this helps,
    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  5. #5
    tukes is offline Junior Member White Belt
    Join Date
    Feb 2008
    Posts
    6

    Re: Developing with MapPoint and Excel - Getting Started

    Hi Erick,
    I have been following the tutorial to work out how to do the programing.
    I cant select Microsoft Mappoint11.0 Object... I only have the 13.0 version. I have selected this, but cant get the button to work.
    any ideas?
    Tom

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

    Re: Developing with MapPoint and Excel - Getting Started

    Do you want to post your spreadsheet here as an attachment? I will take a look. What version of Excel and MapPoint do you have (NA or EU) ?

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

  7. #7
    Lagair is offline Junior Member White Belt
    Join Date
    Aug 2008
    Posts
    2

    Re: Developing with MapPoint and Excel - Getting Started

    Hi Eric,

    I have been playing with this problem only for a weekend, but your code seems to work beautifully, after editing for my current version of MapPoint.

    However, I was wondering if there was a way to automate the closing of MapPoint after the code has ran, without saving the map of course. Then I can set the Visible to false and make it look automagical.

    Thanks in advance.

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

    Re: Developing with MapPoint and Excel - Getting Started

    Actually if you just put the oApp statement inside the Sub then it will go out of scope and close... this would be one way to do it.


    Code:
    Private Sub CommandButton1_Click()
    
      Dim oApp As MapPoint.Application
    
      Set oApp = CreateObject("MapPoint.Application.NA.11")
      oApp.Visible = True
    
    End Sub
    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  9. #9
    Lagair is offline Junior Member White Belt
    Join Date
    Aug 2008
    Posts
    2

    Re: Developing with MapPoint and Excel - Getting Started

    That works, MapPoint closes, but it still asks to save the map. I am a non-programmer and am not sure how to work around this.

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

    Re: Developing with MapPoint and Excel - Getting Started

    Just put in there a statement objMap.Saved = True..

    You also need a objMap object. All the code would look like:

    Code:
    Private Sub CommandButton1_Click()
    
      Dim oApp As MapPoint.Application
      Dim objMap As MapPoint.Map
    
      Set oApp = CreateObject("MapPoint.Application.NA.11")
      oApp.Visible = True
    
      Set objMap = objApp.ActiveMap
      objMap.Saved = True
    
    End Sub
    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Getting Started with VB6 and MapPoint 2004
    By takk in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 08-17-2010, 05:34 PM
  2. addpushpin - need help to get started
    By BWard in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 12-19-2005, 02:15 PM
  3. Getting Started with the Virtual Earth Map Control
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 0
    Last Post: 08-02-2005, 03:39 PM
  4. I am developing an application using Mappoint web ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-02-2002, 07:11 AM
  5. I am developing an application using Mappoint web ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 12-31-1969, 06:48 PM

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