View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rutherford Rob Rutherford is offline
external usenet poster
 
Posts: 13
Default Using an ActiveXDll with Excel 2002 when the DLL uses a VB Form and VBA uses a Userform

If I open the VB6 form modally from an XL2002 userform, it seems OK - that is, the
userform sits there visible but I can't switch to it until I have finished with the VB form
and closed it. Is that what you want?


"Howard Kaikow" wrote in message ...
The problem is that there's a VBA Userform running in Excel and Excel is not
playing nice with VB when I use a modal VB Form while the Excel Userform is
running.

I was thinking that I might try hiding the VBA Userform.

--
http://www.standards.com/; Howard Kaikow's web site.
------------------------------------------------
"Rob Rutherford" wrote in message
...
Howard,

I wasn't going to reply because I don't think I understand your problem

(particularly
the significance of your line 'The VB code shows the Form 3 times.').

However, nobody
else has replied, so you may wish to know that a VB6 dll used from Excel

can display
a VB6 form correctly (modeless or modal). Is that of any interest to you?

Regards,
Rob Rutherford


"Howard Kaikow" wrote in message

...
I have an Excel workbook in which ALL code is in a class, other than the
code necessary to instantiate the class and load a VBA Userform. I then
compile the class with VB 6 and use the compiled DLL. No problem so far.

But then I got greedy and attempted to try something I've not tried

before.

To the VB 6 class, I added a VB Form.
The VB code shows the Form 3 times.
If I make the Form modeless, as expected, all the user sees is the last
display of the Form.
If I make the Form modal, then Excel gets hung waiting for the VB Form

to do
its thing each time it is displayed, so using vbModal appears to not

work,
and I expected this.

How do I work around this?

Does VB have to get the handle of the VBA Userform and then make sure

that
the VB Form gets displayed on top of the VBA Userform?
Or is there an easier way?

--
http://www.standards.com/; Howard Kaikow's web site.
------------------------------------------------