VBALOAD Problem

Discussion in 'AutoCAD' started by thenov, Oct 23, 2004.

  1. thenov

    thenov Guest

    I have a vaild VBA Application that works fine when run from the VB Editior. Now I am trying to use lisp to define a command to run the VBA Applicaiton. I have sucessfully done this. My probelm is that if I run the Lisp command IN THE DEFUALT DRAWING THE FIRST TIME AUTOCAD IS LOADED I get a Run-Time Errror 53 File Not Found. If I hit END and run the lisp command again it works fine.

    What is really strange is that it only happens in the first drawing when AUtoCAD is first loaded. All drawings after that work fine. Here is my lisp code to call the VBA Application.

    ;;; Load OCS TAG Program Macro for Events
    (princ "\n\tLoading OCSD Tags...")
    (vl-vbaload "I:\\ACAD\\PROJ\\P2-80\\PDR\\DATA\\OCSD_TAGS.dvb")
    (princ "Load Complete.\n")


    ;;; define the OCS Tagging Program Command Name
    (defun c:eek:ts ()
    (princ "\nOCSD Tagging System <<Version 2004-R1>> - (C) 2004, Malcolm Pirnie Inc.\n") ; print message to screen
    (vl-vbarun "I:\ACAD\PROJ\P2-80\PDR\DATA\OCSD_TAGS.dvb!Module1.OTAGTAB")
    (princ)
    )

    Again I only get the Run-Time Error 53 in the first drawing when AutoCAD loads. After that all works fine. Any Ideas would be greatly appreciated. Thanks!
     
    thenov, Oct 23, 2004
    #1
  2. (vl-vbarun "I:\ACAD\PROJ\P2-80\PDR\DATA\OCSD_TAGS.dvb!Module1.OTAGTAB")

    You need two slashes in strings:

    "I:\\ACAD\\PROJ\\P2-80\\PDR....."
     
    Tony Tanzillo, Oct 23, 2004
    #2
  3. thenov

    thenov Guest

    Thanks for the input. Unfortunately it did NOT work. Again my problem only occurs in the first drawing when AutoCAD has just been loaded. After that it loads and runs fine.
     
    thenov, Oct 25, 2004
    #3
  4. thenov

    thenov Guest

    Thanks! I was getting the path to my new app from the VBE Current Project property. The first time the new app was run it was defaulting to the folder where my ACAD.DVB was located. I was able to fix it by unloading ACAD.DVB.
     
    thenov, Oct 25, 2004
    #4
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.