excel loses functionality when a Map Point Active X Control is accessed through VBA

R

ruyasan

I'm having a lot of trouble finding a solution to my problem becaus
even though there are great resources around for Excel programing an
Map Point programing, there is almost nothing about useing the
together.

Having said that, I assume that what I describe below happens with an
complex Active X control so perhaps somebody here can help me.

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

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

1. I open up my spreadsheet (with the embedded MPControl) and excel i
fully functional

2. I hit a button which uses the map point control to calculate a ma
point route (for those unfamiliar with map point - all that matter
here is that I accessed an Active X Control from VBA in this step)

3. Excel is no longer fully functional. I can still edit the content
of cells but nothing much else works (for example, Validation an
Format Cell are grayed out in all the menues - as well as any othe
functions which affect the way cells work)

4. I found out that if I select something within the embedded control
(like a city name) and then select something back inside th
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 rout
calculation function:

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

This does not return excel to normal functionality (even though if
physically select something in the MPControl and then a cell everythin
is back to normal). This is a BIG problem for me because I have
function which ads special validation requirements to a cell based o
data returned from the MPControl. Since the validation functionality o
excel turns off as soon as the map point control is accessed, th
program crashed with the message:

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


It seems as though as soon as objects within the map point control ar
accessed, a bunch of objects within excel's object tree disapear fo
that while. So, how do I make them come back?

I'm really REALLY stuck on this - so any help would be infinatel
apretiated
 
R

ruyasan

whoops - I'm really sorry for the spam

I had trouble submitting new topics and when they didn't show up here
assumed it was safe to just send them again

my appologie
 
R

ruyasan

if it helps, I noticed that excel exhibits similar behavior when on
clicks on ANY active X control (such as a plain old command button)

however, with something like a command button, doing a simpl
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 th
MPControl focus in a way different from what the Select metho
provides

I still don't know how to address this though :(

Could anyone at least acknowledge that what I'm writing makes an
sesnse at all? Could this be a bug? Can anyone help me in any way wha
so ever? I've alreay wasted 2 days on this bloody glitch, so AN
suggestion would be apretiated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top