Automatically run Script file

Discussion in 'AutoCAD' started by CLR, Dec 31, 2003.

  1. CLR

    CLR Guest

    Hi All...........

    I'm trying to write a macro in Excel-VBA that will start AutoCad and run an
    external script file called script.scr

    Here's my code so far..........it will open AutoCad and open the test.dwg
    file and execute the script command and open a dialog box to choose a script
    file, but then will not accept the script.scr filename nor a
    "Enter"........it just hangs there



    Sub StartAutocad()
    Dim oAutoCad As Object
    Set oAutoCad = GetObject("c:\test.dwg")
    oAutoCad.sendcommand "script" & vbCr 'this line opens the choose
    file dialog box
    oAutoCad.sendcommand "script.scr" & vbCr 'this line don't appear to
    work at all

    Any help would be appreciated..........

    Vaya con Dios,
    Chuck, CABGx3
     
    CLR, Dec 31, 2003
    #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.