Utility to Quickly Convert VBA Forms to VB Forms

Utility to Quickly Convert VBA Forms to VB Forms

Anonymous
Not applicable
4,066 Views
9 Replies
Message 1 of 10

Utility to Quickly Convert VBA Forms to VB Forms

Anonymous
Not applicable
Does anybody know if there is a quick utility to convert a VBA form to a VB form?

I have inherited this huge vba program -- its taken a whole day just converting like 1/2 of all those forms -- and I am considering various options on how to best inherit it with scalability in mind.

I have been doing a lot of soul searching to find out the best and fastest way to deal with this -- and the viable way that keeps popping out is convert all to VB.

Thank you so much for all the kind help you can give. All suggestions welcome.

Matt
0 Likes
4,067 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
Thats okay -- I think I have the quick form conversion I am looking for -- what I did was do a file export of the forms from inside VBA, then from VB add a form and navigate to those exported forms.

Its quick, unfortunately it comes up as a form with a funny looking triangle inside VB (no big deal unless it mean some kind of danger I might not be aware of at the moment -- kindly advise) -- I havent tested an exe created from it (crossing fingers) hoping all goes well.

Matt
0 Likes
Message 3 of 10

Anonymous
Not applicable
Form exported from VBA is different from the intrinsic form in VB. When you
added into a VB project, as you have noticed, it is not under the "Forms"
folder, instead, it is under "Designers" folder, because the form is from a
foreign environment (VBA). That means your VB project is added one or more
dependency files, which may or may not present on the computers of the
targeting users of your app.

It is not recommended to export VBA form and add to VB project, unless you
have no other options. Basically, you need to recreate those forms in VB.

wrote in message news:4877848@discussion.autodesk.com...
Thats okay -- I think I have the quick form conversion I am looking for --
what I did was do a file export of the forms from inside VBA, then from VB
add a form and navigate to those exported forms.

Its quick, unfortunately it comes up as a form with a funny looking triangle
inside VB (no big deal unless it mean some kind of danger I might not be
aware of at the moment -- kindly advise) -- I havent tested an exe created
from it (crossing fingers) hoping all goes well.

Matt
0 Likes
Message 4 of 10

Anonymous
Not applicable
Thanks Norman,

What you have presented is a really interesting concept on dependencies -- I will try to dig deeper into this..

Matt
0 Likes
Message 5 of 10

wesbird
Collaborator
Collaborator
I found this at:
VBA2VBFormConverter.zip
http://www.cadvault.com/forums/showthread.php?t=2442
I never try it before and hope it help.



Wes
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
0 Likes
Message 6 of 10

GTVic
Advisor
Advisor
I believe VBA and VB forms are fundamentally different so that is why it is difficult to find such a utility. I think your best bet is to create a new form and copy only the code over with minor changes such as the focus events.
0 Likes
Message 7 of 10

Anonymous
Not applicable
Thanks Wes I will go and give it a try.

Gratefully,
Matt
0 Likes
Message 8 of 10

Anonymous
Not applicable
Thanks for your answer
Yes, what you mention is one of the ideal solutions .. what you say will give me ability to work with control arrays from VB of which I am fond of.

The events of the controls in the VBA form I am inheriting unfortunately will have to undergo major changes when I do a direct manual copy from VBA to VB the reason being that none of those controls are control arrays (since VBA is not capable of creating control arrays) and I find event triggers with non-arrayed controls too cumbersome --

Your solution is one of the best but will take awhile.

Matt
0 Likes
Message 9 of 10

Anonymous
Not applicable
As Wes mentions later in the group, there is a routine written by a chap
from Hawaii, Leslie Lowe. I used it 12 months ago and found it excellent.

Jon
Message 10 of 10

Anonymous
Not applicable
This has me really excited -- I can't wait to give the program a try -- thanks Jon

Gratefully,
Matt
0 Likes