MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




MPControl embedded in excel - excel loses functionality

This is a discussion on MPControl embedded in excel - excel loses functionality within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Sorry for all the questions but it seems there isn't much literature on-line about embedding Map Point into excel, so ...


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

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



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-17-2004
Junior Member
White Belt
 
Join Date: May 2004
Posts: 4
MPControl embedded in excel - excel loses functionality

Sorry for all the questions but it seems there isn't much literature on-line about embedding Map Point into excel, so this is the only place I know of to come for help. I tried searching these forums as well but it looks like nobody ran into my problem so far.


Basically I have a map point controll embedded into excel. The problem is that once the controll is accessed in any way from VBA, excel seems to "lose focus" and a lot of its features become unavailable.

Its a little hard to explain, but I shall try to illustrate what is happeing:

1. I open up my spreadsheet (with the embedded MPControl) and excel is fully functional
2. I hit a button which calculates a route based on information in some cells. The route is calculated and displayed in the embedded control.
3. Excel is no longer fully functional. I can still edit the contents of cells but nothing much else works (for Example, validation and Format Cell are grayed out in all the menues - as well as any other functions which affect the way cells work)
4. I found out that if I select something within the embedded controll (like a city name) and then select something back inside the spreadsheet (like some cell) then everything returns to normal

The problem is that I cannot replicate step 4 programatically.

For instance, I have some code that does this at the end of my route calculation function:

locPickUp.Select
wksDispatch.Range("A1").Select

This does not return excel to normal functionality. This is a BIG problem for me because I have a function which ads special validation requirements to a cell based on a route look-up. Since the validation functionality of excel turns off as soon as the map point control is accessed, the program crashed with the message:

"Automation Error:
The object involved has disconnected from its clients."


Now, I am not TOO familiar with the inner workings of MS Office objects, but I'm guessing that while the map point controll is accessed, the object tree for excel is temporarily turned off so that the Map Point object tree can be used instead. So how would I go about letting VBA know that I would like to turn the excel tree back on?

I'm really REALLY stuck on this - so any help would be infinately apretiated!
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 05-19-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
if it helps, I noticed that excel exhibits similar behavior when one clicks on ANY active X control (such as a plain old command button)

however, with something like a command button, doing a simple Cells(1,1).Select returns excel to its normal functionality

this doesn't work with the MP Control

in other words - it seems that what happens is excel assigns the MPControl focus in a way different from what the Select method provides

I still don't know how to address this though

Could anyone at least acknowledge that what I'm writing makes any sesnse at all? Could this be a bug? Can anyone help me in any way what so ever? I've alreay wasted 2 days on this bloody glitch, so ANY suggestion would be apretiated!
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 05-20-2004
Junior Member
White Belt
 
Join Date: May 2004
Posts: 4
for anyone who got here by way of google, the solution turns out to be to select the worksheet explicitly first, then some cells within it

for example:

myMapPointControl.NewMap geoNorthAmerica
Worksheets(1).Select
Worksheets(1).Range("A1").Select

will let you access the MPControl and then restore excel to status quo
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
embedded, excel, functionality, loses, mpcontrol


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
UDF in Excel Bob Jeffery MapPoint 2006/2009 Discussion 2 08-12-2005 01:38 PM
updating an embedded map in Excel Anonymous MapPoint 2006/2009 Discussion 0 08-26-2004 12:44 PM
Updating an embedded map in Excel from linked data Matt MapPoint 2006/2009 Discussion 0 05-13-2003 09:27 AM
Extracting to Excel Anonymous MapPoint 2006/2009 Discussion 1 12-13-2002 10:38 AM
Excel Integration is not available Anonymous MapPoint 2006/2009 Discussion 0 10-24-2002 07:40 AM


All times are GMT -5. The time now is 02:22 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Luxor Holiday
Book your Luxor holiday through UlookUbook and visit this destination stooped in history.



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