MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Cannot CreateObject("MapPoint.Application")

This is a discussion on Cannot CreateObject("MapPoint.Application") within the MapPoint 2006/2009 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 ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-06-2006
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
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 10-06-2006
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!
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 10-06-2006
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)"
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 10-06-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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 12:59 PM.
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 10-06-2006
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
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 10-07-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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.
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 10-09-2006
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.
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 10-10-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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 ?
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 10-10-2006
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")"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 10-11-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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.
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


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/cannot-createobject-mappoint-application-5256.html

Posted By For Type Date
Acc2003 - Mappoint 2006 TimeOut - MS-Office-Forum This thread Refback 12-24-2007 02:24 AM
Acc2003 - Mappoint 2006 TimeOut - MS-Office-Forum This thread Refback 01-18-2007 02:55 AM

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
MapPoint 2004 Active-X control: how to "bump" pus citrix_99301 MapPoint 2006/2009 Discussion 3 03-18-2006 02:50 AM
Mappoint exception "Call was rejected by callee" jliao81 MapPoint 2006/2009 Discussion 1 06-03-2005 07:53 AM
Do I need "Autoroute Europe", if I install "M bigtail MapPoint 2006/2009 Discussion 1 03-23-2004 11:58 PM
MapPoint "Fleet Application" definition Anonymous MapPoint 2006/2009 Discussion 5 08-26-2003 02:16 PM
"Microsoft Mappoint" writing and Pushpin Highligth feanor MapPoint 2006/2009 Discussion 0 03-12-2003 04:47 AM


All times are GMT -5. The time now is 01:36 AM.


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

Holidays Benidorm
Make your holidays in Benidorm to enjoy over 1000 bars, clubs and restaurants! The beaches are superb with great facilities and watersports. Book online...

Honeymoon Holidays
Book your Honeymoon holiday with Travel Counsellors. A personal advisor will help you plan the perfect honeymoon holiday.

Holiday Cuba
Most of all though, you will remember your Holiday in Cuba for the people. Naturally open and friendly with the warmest welcome in the Caribbean. Book at dealchecker.co.uk today.

All Inclusive Maldives
Visit The Holiday Place.co.uk for great deals on all inclusive holidays to the Maldives. Book a holiday to the outstandingly beautiful Maldives.

Holidays
For bargain holidays to destinations including Mexico, South Africa, India and more, visit ULookUBook online today. Check out our free travel guides to help you make an informed decision for your holidays.

Inclusive late deals
For inclusive late deals, check out your options at Travel.co.uk and have fun!

Gran Canaria Holidays
Visit the Canary Islands! See information on Gran Canaria holidays at On The Beach!


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