Community of VE/MapPoint Users and Developers
This is a discussion on Access Denied Error on DisplayDataMap within the Development forums, part of the MapPoint 2006/2009 Discussion category; I am creating maps using Excel macros. When processing encounters the following code: Set objDataMap = _ objDataSet.DisplayDataMap(geoDataMapTypeShadedArea , objField, ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Set objDataMap = _ objDataSet.DisplayDataMap(geoDataMapTypeShadedArea , objField, _ geoShowByRegion2, geoCombineByDefault, _ geoRangeTypeUniqueValues, geoRangeOrderDefault, 15) It errors with the following error text: Runtime Error: '-2147024891 (800700005)': Access Denied When the same code runs for a map that shows quintiled counties no problem. But when it runs for a map showing seed territories...BLAM!!...huge error. This is driving me nuts...I cannot find any info about the error anywhere. |
| |||
| Re: Access Denied Error on DisplayDataMap
Eric, I tried to post a PTM file and could not do it. I was using the manage attachments tool in the reply to thread application. Is there another way? Thanks, Tbird Last edited by Eric Frost; 01-16-2008 at 10:41 AM. |
| |||
| Re: Access Denied Error on DisplayDataMap
Thanks for the help with posting the files. I do not have zip software on my computer at work as we are pretty limited to what we get as far as software is concerned. Here is some code that might help: Code:
Public Sub GenerateTerritory_Data_Map(strBook As String, strSheet As String, strContext As String)
Dim strLegendTitle As String
DataPath = Left(AbsPath, InStrRev(AbsPath, "\") - 1)
DataFile = DataPath & "\" & strBook & "!" & strSheet
If Not UCase(strContext) Like "*TERRITORY*" And Not LCase(TableName) Like "*datamap*" Then
Set objDataSet = objMap.DataSets.ImportTerritories(DataFile, aFields, geoCountryUnitedStates, , geoImportExcelSheet)
Else
Set objDataSet = objMap.DataSets.ImportData(DataFile, aFields, geoCountryUnitedStates, , geoImportExcelSheet)
If InStr(strContext, "bu") > 0 Then
Set objField = objDataSet.Fields("business unit")
strLegendTitle = "Business Units"
ElseIf InStr(strContext, "district") > 0 Then
If InStr(strContext, "datamap") > 0 Then
Set objField = objDataSet.Fields("Quintile Label")
strLegendTitle = "Quintiled Counties"
Else
Set objField = objDataSet.Fields("dist desc")
strLegendTitle = "Districts"
End If
ElseIf InStr(strContext, "territory") > 0 Then
If InStr(strContext, "datamap") > 0 Then
Set objField = objDataSet.Fields("Quintile Label")
strLegendTitle = "Quintiled Counties"
End If
Else
Set objField = objDataSet.Fields("terr desc")
strLegendTitle = "Territories"
End If
Set objDataMap = objDataSet.DisplayDataMap(geoDataMapTypeShadedArea, objField, _
, geoCombineByDefault, geoRangeTypeUniqueValues, geoRangeOrderDefault, 15)
End If
MsgBox "Order of data ranges in data map: " & _
objDataMap.DataRanges.DataRangeOrder
If Not UCase(strContext) Like "*TERRITORY*" Or LCase(TableName) Like "*datamap*" Then
objDataMap.LegendTitle = strLegendTitle
End If
objMap.MapStyle = geoMapStyleData
' If strLegendTitle = "Quintiled Counties" Then
' objDataSet.ZoomTo
' End If
'
' If the level is under national, zoom in
If Not UCase(strContext) Like "*NATIONAL*" Then
ResizeMap
'objDataSet.ZoomTo
End If
' Set the territory labels
If UCase(strContext) Like "*TERRITORY*" And Not LCase(TableName) Like "*datamap*" Then
objDataMap.LegendTitle = strLegendTitle
AddTerritoryLabel strContext
End If
End Sub
hierarchy_national_seed for the first tab in excel spreadsheet hierarchy_district_seed for the next 1 to 4 tabs hierarchy_territory_seed for the rest of the tabs Thanks Tbird ![]() Last edited by Paul Larson; 01-21-2008 at 07:43 AM. Reason: insert CODE block, remove HTML formatting for legibility |
| |||
| Re: Access Denied Error on DisplayDataMap
TBird, I was able to dowload your zips. Could you post the XLS also? (There's some stuff missing from your posted code) Mike Mattys |
| |||
| Re: Access Denied Error on DisplayDataMap
TBird, My email is: mmattys at rochester.rr.com |
![]() |
| ||||
| Posted By | For | Type | Date | |
| MapPoint CD, MapPoint Web Service, Virtual Earth, and other Mapping Solutions - MSDN Forums | This thread | Refback | 01-30-2008 02:14 AM | |
| Virtual Earth December Updates - MapPoint News - MP2K Magazine | This thread | Refback | 01-16-2008 10:31 AM | |
| About MP2Kmag - MP2K Magazine | This thread | Refback | 01-16-2008 04:13 AM | |
| About MP2Kmag - MP2K Magazine | This thread | Refback | 01-16-2008 04:13 AM | |
| Author - MP2K Magazine | This thread | Refback | 01-16-2008 04:13 AM | |
| About MP2Kmag - MP2K Magazine | This thread | Refback | 01-16-2008 04:13 AM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 01-15-2008 01:56 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Access denied trying to set waypoint.preferredarrival | stephenmillington | MapPoint 2006/2009 Discussion | 2 | 07-14-2008 01:46 PM |
| Mappoint access denied error | rskrzydlo | MapPoint 2006/2009 Discussion | 7 | 01-29-2007 10:29 PM |
| Access denied using 'PreferredDeparture' | denjoyner | MapPoint 2006/2009 Discussion | 0 | 06-16-2005 10:27 AM |
| MapPoint: Error - Access Denied | Anonymous | MapPoint 2006/2009 Discussion | 0 | 01-17-2005 07:34 AM |
| access denied: Interop | Anonymous | MapPoint 2006/2009 Discussion | 0 | 06-28-2003 03:22 AM |
Ski Chalet
Fancy a ski chalet? Relax in comfort and style between skiing sessions. Holiday Hypermarket makes it easy for you to specify what kind of accommodation you want.
Cyprus Weather
Check out Cyprus Weather - Travel Counsellors details information on Cyprus including, weather, flights and accommodation.
Cuba Holiday
A Cuba Holiday has so much to offer with numerous different cultures affecting the sights, sounds and tastes. Visit this fascinating country with dealchecker.co.uk.
Bahamas Holidays
Bahamas Holidays offer pure blue skies, soft white beaches and the holiday of a lifetime. Visit us for a great deal to the Bahamas.
Cheap Cyprus Holidays
Finding cheap Cyprus holidays can be difficult unless you know where to look and where to book. With ulookubook.com you can conduct a simple search to find the latest holiday deals to your particular destination.
Bargain family holidays
We can help you find family holidays at bargain prices when you check out the options at Travel.co.uk
Holidays in Cyprus
Visit the tombs of the island kings! Visit On The Beach for information on holidays in Cyprus.