MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Please Help! Exporting data from Mappoint

This is a discussion on Please Help! Exporting data from Mappoint within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (6) Thread Tools Display Modes
  6 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-09-2007
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-09-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,470
Blog Entries: 1
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 07-09-2007
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"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 07-09-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,470
Blog Entries: 1
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 07-09-2007
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 07-09-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,470
Blog Entries: 1
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 07-09-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,470
Blog Entries: 1
Re: Please Help! Exporting data from Mappoint

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

"Queryshape GetDemographics"

Eric
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 07-10-2007
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 07-10-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,470
Blog Entries: 1
Re: Please Help! Exporting data from Mappoint

Let us know how it goes!

Eric
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
data, exporting, mappoint


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/please-help-exporting-data-mappoint-6043.html

Posted By For Type Date
Gmane -- Mail To News And Back Again This thread Refback 01-19-2008 12:08 PM
MapPoint Download - MP2K Magazine This thread Refback 07-19-2007 07:10 AM
Microsoft MapPoint 2006 - MP2K Magazine This thread Refback 07-18-2007 11:20 AM
Programming MapPoint in .NET - MP2K Magazine This thread Refback 07-16-2007 07:54 AM
Microsoft MapPoint 2006 - MP2K Magazine This thread Refback 07-12-2007 11:11 AM
The Magazine for MapPoint - MP2K Magazine This thread Refback 07-10-2007 04:55 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Problems exporting MapPoint data to Excel in embedded map o0beaner MapPoint 2006/2009 Discussion 4 03-12-2007 03:14 PM
Exporting Data kdulaney MapPoint 2006/2009 Discussion 0 05-17-2005 03:37 PM
Exporting MapPoint data mr4tno MapPoint 2006/2009 Discussion 1 05-11-2005 01:08 PM
exporting data Anonymous MapPoint 2006/2009 Discussion 3 02-15-2005 01:06 PM
Exporting Data from MapPoint Anonymous MapPoint 2006/2009 Discussion 0 12-16-2004 12:23 PM


All times are GMT -5. The time now is 07:08 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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