Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Convert VBA code to VB code

  1. #1
    Member
    Join Date
    2004-05
    Posts
    22
    Login to Give a bone
    0

    Default Convert VBA code to VB code

    I've been looking at visual basic and like the extra stuff it offers. Does anyone know if there a painless way of converting VBA code to VB code, using some third party software perhaps? Alternatively does anyone know of any place I might find comparison information/charts so that I can work through my code to convert it myself?

    Thanks in advance

  2. #2
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2015-10
    Location
    New York NY
    Posts
    1,497
    Login to Give a bone
    0

    Default Re: Convert VBA code to VB code

    I found a book: The .NET Languages: a quick translation guide. The subtitle tells it all: Learn to convert programs among VB 6.0, VB.NET and C#

    The author is Brian Bischof. I found it remaindered for about $3.99 at Edward Hamilton Books.

    I've opened a discussion on this topic, as I sense a lot of the VBA world is waking up to the changes coming. See my post on the future of VBA.

  3. #3
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,419
    Login to Give a bone
    0

    Default Re: Convert VBA code to VB code

    Are you wanting to convert to VB6 or .Net? There really isn't much to "convert". Just export your modules from the dvb. If you have forms in your dvb, that will take some conversion, but some have written code to handle that.
    C:> ED WORKING....


    LinkedIn

  4. #4
    Member
    Join Date
    2004-05
    Posts
    22
    Login to Give a bone
    0

    Default Re: Convert VBA code to VB code

    Thanks guys.
    I've been writing code to provide interaction between AutoCAD and Access.
    VBA is what I have written, and VB 2005 is what I want to change to.
    I may be wrong but I gather I can get more functionality, better looking forms and controls, and the ability to package my code as a freestanding exe. VB 2005 also offers a host of automated database interaction - I can use it to get to my Access databases without having to write much code at all (OK so I'm lazy....).

  5. #5
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,419
    Login to Give a bone
    0

    Default Re: Convert VBA code to VB code

    Quote Originally Posted by plattrj
    without having to write much code at all (OK so I'm lazy....).
    You've been listening to salesmen, right?
    C:> ED WORKING....


    LinkedIn

  6. #6
    Member
    Join Date
    2004-05
    Posts
    22
    Login to Give a bone
    0

    Default Re: Convert VBA code to VB code

    Hi Ed,
    Sounds like you are trying to tell me not to bother? Maybe VBA actually has everything I need and I just haven't found it yet.
    I must say I've already achieved more with my VBA efforts than I ever thought possible, and I'm certainly delighted I made the change from Lisp (although I'm still using a lisp program to start my VBA program).

  7. #7
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2015-10
    Location
    New York NY
    Posts
    1,497
    Login to Give a bone
    0

    Default Re: Convert VBA code to VB code

    Quote Originally Posted by plattrj
    Hi Ed,
    Sounds like you are trying to tell me not to bother? Maybe VBA actually has everything I need and I just haven't found it yet.
    I must say I've already achieved more with my VBA efforts than I ever thought possible, and I'm certainly delighted I made the change from Lisp (although I'm still using a lisp program to start my VBA program).
    Are you ready for some real fun?

    Start Excel or Word from Acad VBA and take info from your drawing and dump it into Excel...

  8. #8
    Member
    Join Date
    2004-05
    Posts
    22
    Login to Give a bone
    0

    Default Re: Convert VBA code to VB code

    Actually I sent my data to Excel before I tried Access. I found Access more difficult to set up but now it is done it allows me to query data more efficiently (and from more than one table at a time). I use the element (usually a polyline) handle as the key in Access so clicking on an element pops up a form with the data relevant to that element.
    I'm doing land use and masterplanning so this is already saving wads of time.
    It's a kind of mini GIS.
    What I like about VB is all the database linking automation it has prebuilt into some of the controls - hence my exploration for converting my code from VBA to VB.

  9. #9
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,419
    Login to Give a bone
    0

    Default Re: Convert VBA code to VB code

    Quote Originally Posted by plattrj
    Hi Ed,
    Sounds like you are trying to tell me not to bother? Maybe VBA actually has everything I need and I just haven't found it yet.
    No, I just think you have the wrong idea about .Net, specifically that you won't have to write much code. Yes .Net, or more specifically, ADO.Net, has more to offer, but that doesn't equate to less code. It seems to be just the opposite when you are dealing with the .net api for acad.
    C:> ED WORKING....


    LinkedIn

  10. #10
    Member
    Join Date
    2004-05
    Posts
    22
    Login to Give a bone
    0

    Default Re: Convert VBA code to VB code

    Looks like I should just make a point of exploring VBA a bit further.
    When I looked at the extra controls that are available (the ones that aren't on the standard tab) I see that some of the database controls I've seen in .Net seem to be available for VBA as well. So I'll give these a try and see where it takes me.
    Thanks all, for the advice.

Page 1 of 3 123 LastLast

Similar Threads

  1. Allow Other Code Compilers for ARX Code
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2013-02-10, 08:06 AM
  2. Need help with code
    By paulof in forum AutoLISP
    Replies: 6
    Last Post: 2008-06-25, 06:23 PM
  3. Insert vbscript code has not code
    By buzz in forum AMEP General
    Replies: 3
    Last Post: 2008-02-09, 03:08 AM
  4. Convert AutoCAD DWG file to G-Code
    By num1husker in forum AutoCAD General
    Replies: 3
    Last Post: 2007-03-09, 09:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •