Results 1 to 2 of 2

Thread: DDE to send AutoCAD LT commands from Excel not passing file name

  1. #1
    Member
    Join Date
    2012-01
    Location
    Texas
    Posts
    40
    Login to Give a bone
    0

    Default DDE to send AutoCAD LT commands from Excel not passing file name

    I am trying to run a script in AutoCAD LT from and Excel macro.

    My macro so far is:

    Sub Test()
    Dim channelnumber As Long
    Dim SCRfilename As String
    SCRfilename = TestFile
    channelnumber = Application.DDEInitiate(app:="AutoCAD LT.dde", topic:="system")
    Application.DDEExecute channelnumber, "filedia 0" & vbCr
    Application.DDEExecute channelnumber, "Script "
    Application.DDEExecute channelnumber, Chr(34) & SCRfilename & Chr(34) & vbCr

    End Sub


    AutoCAD is not getting the SCRfilename variable. When I look at the command line, it receives the "", but nothing in between. Can someone tell me what is wrong with my syntax?

  2. #2
    Member
    Join Date
    2012-01
    Location
    Texas
    Posts
    40
    Login to Give a bone
    0

    Default Re: DDE to send AutoCAD LT commands from Excel not passing file name

    [QUOTE=apitcher799568;1183175]

    SCRfilename = TestFile


    Silly me. Should be SCRfilename = "TestFile" Totally got it to work now.

Similar Threads

  1. Send Cad to excel
    By souvik.gis643461 in forum AutoLISP
    Replies: 0
    Last Post: 2014-05-23, 12:01 PM
  2. Replies: 1
    Last Post: 2012-08-08, 05:50 PM
  3. send AutoLISP Variables to Excel via VB
    By johannvonspiralspine in forum VBA/COM Interop
    Replies: 5
    Last Post: 2010-11-09, 10:19 PM
  4. AutoCAD LT 2007 - Changing keyboard commands in Acad.pgp file
    By son.do in forum AutoCAD LT - General
    Replies: 12
    Last Post: 2009-04-07, 03:04 PM
  5. Replies: 22
    Last Post: 2007-03-29, 01:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •