VB Form vs VBA UserForm problems...

R

R Avery

I come from a VBA environment where I am used to doing things like
abstracting away UI elements like moving items in a listbox up or down
with items... into some DLL that i make with a ListOrderer class which
you use by passing references to the listbox control and all of the
up/down buttons.

Now that I am writing some things in VB6, I found that I cannot simply
just export my VBA (designed in Excel) forms and import them into VB6
Forms. Why do these form objects appear in the "Designers" portion of
the TreeView rather than the "Forms" portion.

So, I started designing a VB6 form, and hoped that it could use the
same ListOrderer class that I used in the VBA form. Unfortunately, VB6
does not use MSForms controls, but rather uses VB controls. VB
controls have different methods, properties, etc! That is one problem
I don't understand, but I can get over it. It means i'd have to design
a new ListOrderer for VB6. So I did that. Unfortunately, it gave me
an error saying that "A property or method call cannot include a
reference to a private object, either as an argument or as a return
value" when I made the arguments to the ListOrderer class VB.Listbox
and VB.Button. So i simply changed them to Object and hoped it would
work.

However, it still doesn't work because when i try to use the
ListOrderer (which is compiled in a separate DLL) in the Standard EXE
Form i am trying to make, it gives me this error again. I looked
online for some descriptions of the error and I found the following
MSDN link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbco...

According to this, I can't pass VB controls to DLLs PERIOD! What is
that? How do you guys abstract UI functionality like drag and drop
items between two listboxes or automatically sync'ing a form's controls
(with set tag properties) to a custom object's properties?

Any help in response to any of my questions above would be greatly
appreciated. Thanks.
 
S

Stephen Bullen

Hi,
Now that I am writing some things in VB6, I found that I cannot simply
just export my VBA (designed in Excel) forms and import them into VB6
Forms. Why do these form objects appear in the "Designers" portion of
the TreeView rather than the "Forms" portion.

Instead of posting this to all the office development newsgroups, you
might get a better response from the Visual Basic newsgroups, such as
public.vb.controls

Regards

Stephen Bullen
Microsoft MVP - Excel

Professional Excel Development
The most advanced Excel VBA book available
www.oaltd.co.uk/ProExcelDev
 

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