VBA's not running right

Discussion in 'AutoCAD' started by cadman_meg, Mar 5, 2004.

  1. cadman_meg

    cadman_meg Guest

    I have several VBA projects other than the acad.dvb. Anyhow, for some reason when I type in the command to run them, they don't. they are all loaded one way or another, wether it be through the acad.lsp or the startup suite. Before I post what I am getting when I try to run the routines, I would like to ask if you guys think all these VBA apps. should be combined to just the acad.dvb? If so, how do I do this? Here is the return I am getting at command line when trying to run vba macro:

    Command: vt _.-VBARUN
    Macro name: vt
    Macro not found.
    Command:

    Command: bcc _.-VBARUN
    Macro name: BlockChangeColor
    Macro not found.
    Command:
    Command: lth _.-VBARUN
    Macro name: LayerTextHeight
    Macro not found.
    Command:
    Command: cev _.-VBARUN
    Macro name: ChangeEnviron
    Macro not found.
    Command:
    Command: txtmrg
    _.-VBARUN
    Macro name: txtmrg
    Macro not found.
     
    cadman_meg, Mar 5, 2004
    #1
  2. cadman_meg

    Anne Brown Guest

    In addition to any replies you might receive or have already
    received, you may find more information or responses by posting
    future VBA related questions in the following discussion group:

    Web browser: http://discussion.autodesk.com/forum.jspa?forumID=33
    Newsreader:
    news://discussion.autodesk.com/autodesk.autocad.customization.vba
     
    Anne Brown, Mar 5, 2004
    #2
  3. For starters, can you run them via the dialog box?

    --
    R. Robert Bell


    I have several VBA projects other than the acad.dvb. Anyhow, for some reason
    when I type in the command to run them, they don't. they are all loaded one
    way or another, wether it be through the acad.lsp or the startup suite.
    Before I post what I am getting when I try to run the routines, I would like
    to ask if you guys think all these VBA apps. should be combined to just the
    acad.dvb? If so, how do I do this? Here is the return I am getting at
    command line when trying to run vba macro:

    Command: vt _.-VBARUN
    Macro name: vt
    Macro not found.
    Command:

    Command: bcc _.-VBARUN
    Macro name: BlockChangeColor
    Macro not found.
    Command:
    Command: lth _.-VBARUN
    Macro name: LayerTextHeight
    Macro not found.
    Command:
    Command: cev _.-VBARUN
    Macro name: ChangeEnviron
    Macro not found.
    Command:
    Command: txtmrg
    _.-VBARUN
    Macro name: txtmrg
    Macro not found.
     
    R. Robert Bell, Mar 5, 2004
    #3
  4. cadman_meg

    cadman_meg Guest

    Yes, I can run them by going through the "vbaman" and then to macros and then run. I have them load automatically or on call. So if they are not in the startup suite, then they are in my acad.lsp as:

    (defun c:vt () (vl-vbarun "vt") (princ))
    (defun c:bcc ()(vl-vbarun "BlockChangeColor")(princ))
    (defun c:lth ()(vl-vbarun "LayerTextHeight")(princ))
    (defun c:cev ()(vl-vbarun "ChangeEnviron")(princ))
    (defun c:txtmrg () (vl-vbarun "txtmrg") (princ))
    (defun c:vpscale () (vl-vbarun "vpscale") (princ))

    Thanks for any help you can supply.
     
    cadman_meg, Mar 5, 2004
    #4
  5. Hi,

    If the file is on the autocad path, put the filename in the defun as
    follows:
    (defun c:vt () (vl-vbarun "Myprogramfile.dvb!vt") (princ))

    If not:
    (defun c:vt () (vl-vbarun "c:\\MyprogramDirectory\\Myprogramfile.dvb!vt")
    (princ))


    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au


    then run. I have them load automatically or on call. So if they are not in
    the startup suite, then they are in my acad.lsp as:
     
    Laurie Comerford, Mar 5, 2004
    #5
  6. cadman_meg

    cadman_meg Guest

    This is what I have now:

    (defun c:vt () (vl-vbarun "vt.dvb!vt") (princ))
    (defun c:bcc () (vl-vbarun "BlockColorChange.dvb!vt") (princ))
    (defun c:lth () (vl-vbarun "TextByLayer.dvb!vt") (princ))
    (defun c:cev () (vl-vbarun "Myprogramfile.dvb!vt") (princ))
    (defun c:txtmrg () (vl-vbarun "txtmrg.dvb!vt") (princ))
    (defun c:vpscale () (vl-vbarun "vpscale.dvb!vt") (princ))
    (defun c:vt () (vl-vbarun "mg.dvb!vt") (princ))
    (defun c:bcc () (vl-vbarun "mg.dvb!vt") (princ))
    (defun c:lth () (vl-vbarun "mg.dvb!vt") (princ))
    (defun c:cev () (vl-vbarun "mg.dvb!vt") (princ))
    (defun c:txtmrg () (vl-vbarun "mg.dvb!vt") (princ))

    I have the duplicates because I do not remember on some of them if the routine was by itself or compiled together with others in one project. I wouldn't think it would stop it from running though. This is what I am getting when I try to run it:

    Command: lth
    _.-VBARUN
    Macro name: mg.dvb!vt
    Macro not found.

    Thanks. And hope to get this fixed. Appreciate the help.
     
    cadman_meg, Mar 5, 2004
    #6
  7. cadman_meg

    cadman_meg Guest

    I also just saw that I left the "!vt" at the end of them all. What goes there in it's place? The command or file? Thanks.
     
    cadman_meg, Mar 5, 2004
    #7
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.