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

Please Help! Exporting data from Mappoint

This is a discussion on Please Help! Exporting data from Mappoint within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi Guys Need some urgent help. Trying to create a function to simply list all Postcode Sectors within a 30 ...

  1. #1
    sugarflux is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    6

    Please Help! Exporting data from Mappoint

    Hi Guys

    Need some urgent help. Trying to create a function to simply list all Postcode Sectors within a 30 minute drivetime of a list of postcodes.

    Almost there - just need a way of getting the data into Excel and i'm stumped. Here's what i have so far:

    Function GetDrivetime(Postcode as String)
    Dim objapp As MapPoint.Application
    Dim objDataSet As MapPoint.DataSet
    Dim objDataMap As MapPoint.DataMap
    Dim objField As MapPoint.Field
    Dim objMap As MapPoint.Map
    Dim objLocation As MapPoint.Location
    Dim objShape As MapPoint.shape

    'Create Mappoint as Object and allow control
    Set objapp = CreateObject("Mappoint.application")
    objapp.Visible = True
    objapp.UserControl = True

    'Add data to current map
    Set objDataSet = objapp.ActiveMap.DataSets.GetDemographics(geoCount ryUnitedKingdom)
    Set objField = objDataSet.Fields(1)
    Set objDataMap = objDataSet.DisplayDataMap(geoDataMapTypeShadedArea , objField, geoShowByPostal2, , , , 15)

    'Find and set location
    Set objMap = objapp.ActiveMap
    Set objLoc = objMap.FindResults(Postcode).Item(1)

    'Create drivetime
    Set objShape = objMap.Shapes.AddDrivetimeZone(objLoc, 30 * geoOneMinute)


    'Need to get this data into Excel! Help!


    objapp.Quit
    Set objapp = Nothing
    End Function


    Please get back asap if you can help out. Urgent!

    Thanks

    sugarflux

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

    Re: Please Help! Exporting data from Mappoint

    You've added the Drivetime, I think the next step would be to use Queryshape.

    If you are running from within Excel VBA, then you can loop through the resulting Recordset and write to Excel cells.

    Eric

  3. #3
    sugarflux is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    6

    Re: Please Help! Exporting data from Mappoint

    Hi Eric

    Thanks for getting back to me. When i try the following line:

    set rst = objapp.queryshape(objShape)

    i get the error "Permission Denied"

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

    Re: Please Help! Exporting data from Mappoint

    Here's the snippet from the Help File --

    Code:
        'Find records in shape
        objshape.Select
        Set objRecords = objDataSet.QueryShape(objshape)
        objRecords.MoveFirst
        Do While Not objRecords.EOF
          lngCount = lngCount + 1
          objRecords.MoveNext
        Loop
        MsgBox "Number of records in shape: " & lngCount
    So you would not use objapp, instead use a dataset object.

    Does that make sense?

    Instead of
    set rst = objapp.queryshape(objShape)
    use
    set rst = objDataSet.queryshape(objShape)

    I think you'll also need to Dim rst.

    Eric

  5. #5
    sugarflux is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    6

    Re: Please Help! Exporting data from Mappoint

    Sorry Eric - my mistake - that's what i meant:

    set rst = objDataSet.QueryShape(objShape)

    returns the permission denied error.

    Also tried
    set rst = objDataSet.QueryAllRecords

    which also produces the permission denied error

    I'm am that desperate to figure this out i've even started looking at api calls to try to call the 'Export To Excel' function from the menu - which is stupidly complicated but i need this out today and running out of time!

    Any other suggestions ?
    Thanks for your help,

    sugarflux

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

    Re: Please Help! Exporting data from Mappoint

    I played around with it for a while in Excel VBA and found the same problem, then I searched in this forum -- MapUser gives a great explanation and the solution!

    See his post at --

    can I get demographic data at 1, 3, and 5 mile radius?

    Hope this helps.
    Eric

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

    Re: Please Help! Exporting data from Mappoint

    By the way, this is the search I did in google

    "Queryshape GetDemographics"

    Eric

  8. #8
    sugarflux is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    6

    Re: Please Help! Exporting data from Mappoint

    Thankyou so much Eric

    You've been a great help!

    I didn't quite get the job out on time but i'm well on my way to getting there this morning,

    sugarflux x

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

    Re: Please Help! Exporting data from Mappoint

    Let us know how it goes!

    Eric

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Problems exporting MapPoint data to Excel in embedded map
    By o0beaner in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 03-12-2007, 03:14 PM
  2. Exporting Data
    By kdulaney in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 05-17-2005, 03:37 PM
  3. Exporting MapPoint data
    By mr4tno in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-11-2005, 01:08 PM
  4. exporting data
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 02-15-2005, 01:06 PM
  5. Exporting Data from MapPoint
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 12-16-2004, 12:23 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 25