Loading VBA Projects

Discussion in 'AutoCAD' started by Rene v/d Zalm, Feb 27, 2004.

  1. Hi everybody, i wonder if anybody out there can tell me if it is possible to
    load a vba project and then activate the macro's under a button. I've made a
    vba and a lisp file called matlist.dvb and matlist.lsp and placed within the
    Acad2004doc.lsp with the following line:

    (autoload "matlist" '("matlist"))

    This wil call my lispfile:

    (defun c:matlist ()

    (setvar "filedia" 0)
    (command "vbaload" "matlist.dvb")
    (setvar "filedia" 1)
    (command "-vbarun" "Module1.matlist")
    (princ)
    )
    (princ)

    Now i can use a button and assign the following line:

    ^C^C(load "matlist") ;matlist

    This works but when the user closes the app, the next time he use the button
    acad says the file is already loaded which is obvious. Can anybody tell me a
    way to get around this problem.

    Thanks for helping me out,
    Rene
     
    Rene v/d Zalm, Feb 27, 2004
    #1
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.