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 2 of 2

VBA help needed using MapPoint.Application object

This is a discussion on VBA help needed using MapPoint.Application object within the MapPoint Desktop Discussion forums, part of the Map Forums category; I'm trying to use some code in an Excel macro, taken from the MSDN site, using the ImportTerritories method. The ...

  1. #1
    SheepWorrier is offline Junior Member White Belt
    Join Date
    Oct 2004
    Posts
    7

    VBA help needed using MapPoint.Application object

    I'm trying to use some code in an Excel macro, taken from the MSDN site, using the ImportTerritories method. The code is as follows:

    Sub CreateTerritoriesMap()

    Dim objApp As New MapPoint.Application
    objApp.Visible = True
    objApp.UserControl = True
    Dim szconn As String
    Dim oDS As MapPoint.DataSet

    With objApp.ActiveMap.DataSets
    'Excel sheet
    szconn = objApp.Path & "\Samples\Terrs.xls!Sheet1!A1:E127"
    Set oDS = .ImportTerritories(szconn, , geoCountryUnitedStates, , geoImportExcelA1)
    End With

    End Sub

    However, the code fails on the first Dim statement as 'User-defined type not defined'. I've referenced the following:

    Microsoft MapPoint 11.0 Object Library (Europe)
    Microsoft MapPoint Control 11.0

    However, looking in the Object Browser only shows a Map and a MapPointUtilities class, i.e. no MapPoint class.

    Where can I get the MapPoint class from? Or, is there another way I could automatically export data from excel and produce a Territory map in MapPoint?

    I am using MapPoint 2004 and VB 6.0 through Excel.

  2. #2
    SheepWorrier is offline Junior Member White Belt
    Join Date
    Oct 2004
    Posts
    7

    Figured it out...

    ...after re-reading (and re-reading) the MSDN documentation I have a working macro to import territories into MapPoint.

    If anybody else needs help with this, then feel free to PM me.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Job Offer: Mappoint / Dot Net Developer Needed ASAP
    By sbrewer in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-20-2006, 09:10 PM
  2. c# ImportData method help needed
    By fletch in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 03-09-2005, 10:15 AM
  3. Less Address Accuracy Needed(!)
    By NickS in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-28-2003, 04:39 AM
  4. route object to drawing object
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-09-2003, 11:29 PM
  5. Help Needed...Received the following Error Reported
    By bkwhite in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-19-2002, 06:31 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