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

Access Denied Error on DisplayDataMap

This is a discussion on Access Denied Error on DisplayDataMap within the Development forums, part of the MapPoint Desktop Discussion category; I am creating maps using Excel macros. When processing encounters the following code: Set objDataMap = _ objDataSet.DisplayDataMap(geoDataMapTypeShadedArea , objField, ...

  1. #1
    tbirdsimplemuse is offline Junior Member White Belt
    Join Date
    Jan 2008
    Posts
    10

    Question Access Denied Error on DisplayDataMap

    I am creating maps using Excel macros. When processing encounters the following code:


    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.

    Any help is appreciated.

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

    Re: Access Denied Error on DisplayDataMap

    Can you post the ptm map files?

    DisplayDataMap is a pain, I would try doing the simplest map first and then add parameters one at a time - you can see if it is just one of the parameters that is making it bomb.

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

  3. #3
    tbirdsimplemuse is offline Junior Member White Belt
    Join Date
    Jan 2008
    Posts
    10

    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
    Attached Files Attached Files
    Last edited by Eric Frost; 01-16-2008 at 10:41 AM.

  4. #4
    tbirdsimplemuse is offline Junior Member White Belt
    Join Date
    Jan 2008
    Posts
    10

    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
    In this instance the strContext looks like this:
    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

  5. #5
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    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

  6. #6
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: Access Denied Error on DisplayDataMap

    TBird,

    My email is: mmattys at rochester.rr.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Access denied trying to set waypoint.preferredarrival
    By stephenmillington in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 07-14-2008, 01:46 PM
  2. Mappoint access denied error
    By rskrzydlo in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 01-29-2007, 10:29 PM
  3. Access denied using 'PreferredDeparture'
    By denjoyner in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 06-16-2005, 10:27 AM
  4. MapPoint: Error - Access Denied
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 01-17-2005, 07:34 AM
  5. access denied: Interop
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 06-28-2003, 03:22 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 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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96