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
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Cannot CreateObject("MapPoint.Application")

This is a discussion on Cannot CreateObject("MapPoint.Application") within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, I am new to MapPoint and using MapPoint 2006. My very first line of MapPoint code throws an error ...

  1. #1
    sharoma is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    8

    Cannot CreateObject("MapPoint.Application")

    Hi, I am new to MapPoint and using MapPoint 2006. My very first line of MapPoint code throws an error "Run-time error '429': ActiveX component cannot create object"

    Here is the code snippet:

    Dim objApp As MapPoint.Application
    Private MyMap As Map

    On Error Goto logerr
    Set objApp = GetObject(, "MapPoint.Application")
    If objApp Is Nothing Then
    Set objApp = CreateObject("MapPoint.Application")
    objApp.Visible = False
    objApp.UserControl = True
    objApp.Activate
    Set MyMap = objApp.NewMap()
    End If


    What am I missing in the code or is it a configuration issue.

    Please Help.

    Thanks

  2. #2
    nearlydistant is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    3

    Mappoint Object Library

    You need to add the Microsoft MapPoint 11.0 Object Library as a reference in the VBA window.

    There is info on how to do this at the top of this page:
    Excel User-Defined Functions and MapPoint - MapPoint Articles - MP2K Magazine

    I was running into the same issue yesterday, and that was all I had to do to fix it.

    Good Luck!

  3. #3
    sharoma is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    8
    Thanks for reply.
    I am using MapPoint 2006
    I had already added the reference for "Microsoft Mappoint 13.0 Object Library (North America)"

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    GetObject generate an exception error 429 when the object is still not existand, see this page: GetObject Function (Visual Basic)

    So if you want to check if it exists already for eventually re-use then you have to place it into an exception block. Something like this:

    Code:
    Try
        GetObject ...
    Catch
        CreateObject...
    End
    I dont know VB, so dont rely on the syntax
    Last edited by Wilfried; 10-06-2006 at 01:59 PM.

  5. #5
    sharoma is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    8
    I commented that part but now it is throwing the same error at "CreateObject("Mappoint.Application")"

    ''''''Set objApp = GetObject(, "MapPoint.Application")
    If objApp Is Nothing Then
    Set objApp = CreateObject("Mappoint.Application")
    Set MyMap = objApp.OpenMap("C:\ITMS\MAPSHARE\ITMS.PTM")
    If (MyMap Is Nothing) Then
    Set MyMap = objApp.NewMap()
    End If
    Else

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    I'm not sure if this is case sensitive: "MapPoint.Application"

    However I see something else in your original post: "Run-time error '429': ActiveX component cannot create object". It seems that you use the ActiveX control also in your application, is that right ? Because as far as I know you can not mix the AcitveX control and the object model in the same application.

  7. #7
    sharoma is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    8
    I tried so many things but nothing works.
    Intrestingly the same code(literally as it is) works like a charm in MapPoint 2004.
    However the same code fails to instanstiate the object(as the error 429 states) when run in MapPoint 2006.
    Note: Interestingly the MapPoint.exe can be seen thru TaskManager.

    Here are some of my observation.
    My Source Code is in VB6 (SP5)
    The VB6 Project adds reference to "Microsoft MapPoint 13.0 Object Library (North America). I am not using MapPoint.ocx to display any Map.

    MapPoint 2004 software is using VC++6 DLLs
    MapPoint 2006 software is using VC++7 DLLs

    Not sure if my PC needs additional runtime files for VC++7 to run effectively.

  8. #8
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Quote Originally Posted by sharoma View Post
    I am not using MapPoint.ocx to display any Map.
    But wy is the error melding complaining about the AcitveX ?

  9. #9
    sharoma is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    8
    Not sure. It fails at with error 429 at the line "Set objApp = CreateObject("MapPoint.Application")"

  10. #10
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Eventually I do a test on my machine. At least we know then if it has something todo with the MapPoint installation. If you send the project to my personal email then I do a short test.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MapPoint 2004 Active-X control: how to "bump" pus
    By citrix_99301 in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 03-18-2006, 03:50 AM
  2. Mappoint exception "Call was rejected by callee"
    By jliao81 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-03-2005, 08:53 AM
  3. Do I need "Autoroute Europe", if I install "M
    By bigtail in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-24-2004, 12:58 AM
  4. MapPoint "Fleet Application" definition
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 08-26-2003, 03:16 PM
  5. "Microsoft Mappoint" writing and Pushpin Highligth
    By feanor in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-12-2003, 05:47 AM

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