VBA and autocad 2000

Discussion in 'AutoCAD' started by mediacad, May 10, 2004.

  1. mediacad

    mediacad Guest

    I have a VBA Programm that uses dbase connection via DAO and ADO.., it works in acad 2002, and 2004 but does'nt work in autocad 2000... what's the reason? is there any solution?
    thanks
     
    mediacad, May 10, 2004
    #1
  2. mediacad

    Ed Jobe Guest

    You can't run a dvb that was compiled in vba6 on a app that only runs vba5. The only way to reverse the code is to export all the forms and modules from a vba6 app and then import them from a vba5 app and let the vba5 app compile it. You end up with 2 versions of the dvb.
     
    Ed Jobe, May 11, 2004
    #2
  3. mediacad

    mediaCad Guest

    that will work even if I used functions as REPLACE which exist juste in
    VBA 6 and not in VBA5 ?
     
    mediaCad, May 11, 2004
    #3
  4. mediacad

    Ed Jobe Guest

    No, that will just get you a vba5 version. Those items will be highligted red as compile errors. If something didn't exist in vba5, you will have to find a workaround. Be aware that, not only were there differences in vba, but the acad object model as well.

    --
     
    Ed Jobe, May 11, 2004
    #4
  5. mediacad

    JRWalker Guest

    This will point out some of the glaring differences that can break your
    program. I have done some cross version programs but you will need to debug
    carefully. I also had issues when the ACAD2000 install did not have its
    service packs applied. Some VB fixes are included in the service packs. Hope
    this helps.

    http://www.vb-helper.com/newvb6.htm

    JRWalker


    works in acad 2002, and 2004 but does'nt work in autocad 2000... what's the
    reason? is there any solution?
     
    JRWalker, May 11, 2004
    #5
  6. mediacad

    MarkusV Guest

    Can't say for sure what the problem is BUT!

    - We have a VBA compiled in Acad 2004 that is working great in Acad 2000. the only problem is that I can't view the source code in Acad2000 and that might be a problem when trying to find the solution.

    First you should check that the commands are working in all versions, the program will not work if you use somehting new to 2002, 2004 and try it on 2000.

    Then you should check all the references used in the project (does everything exists on 2000?) I once had a problem where the code didn't run in Excel97 (compiled in VBA Excel 2002) and the problem was that one reference was missing in Excel97, I removed it and everything worked fine... (if you use the reference in the project it's not good to delete it, probobly try replacing it with an older version might help)

    If not, it is ALWAYS better to compile the project (or make it) on the oldest version you uses. Almost always AutoCad2000 VBA will run on 2002/2004, the other way does not always work because of some new commands (new refrences) that exists in 2002/2004 that will not work in 2000...

    (If I could bet, I would bet that it is the references that is messing it up, probobly the DAO/ADO reference that is of older version on 2000 than on 2002/2004, my guess)
     
    MarkusV, May 12, 2004
    #6
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 (here). After that, you can post your question and our members will help you out.