+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Full Member
    Using
    Civil 3D 2014
    Join Date
    Dec 2013
    Location
    Dallas, TX
    Posts
    74

    Question Opening Excel from AutoCAD

    Registered forum members do not see this ad.

    Is there a way to just open the Excel program and not a specific file from within AutoCAD?


    Thanks

  2. #2
    Full Member benhubel's Avatar
    Computer Details
    benhubel's Computer Details
    Operating System:
    Windows 7
    Discipline
    Manufacture
    benhubel's Discipline Details
    Occupation
    Waterjet Programmer
    Discipline
    Manufacture
    Using
    AutoCAD 2012
    Join Date
    Dec 2015
    Location
    Dallas, Texas
    Posts
    82

    Default

    I don't know details, but I think that this thread can get you started. http://www.theswamp.org/index.php?to...6891#msg436891
    I just now discovered for the first time that I am prone to memory loss.

  3. #3
    Full Member
    Using
    Civil 3D 2014
    Join Date
    Dec 2013
    Location
    Dallas, TX
    Posts
    74

    Default

    Thanks, but I need to just open Excel as if I launched the Excel program from an icon. I don't want to open an already existing file.

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,368

    Default

    Code:
    (setq xls (vlax-create-object "excel.application"))
    (vlax-put-property xls 'visible :vlax-true)
    Be sure to release the xls object when finished.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  5. #5
    Full Member benhubel's Avatar
    Computer Details
    benhubel's Computer Details
    Operating System:
    Windows 7
    Discipline
    Manufacture
    benhubel's Discipline Details
    Occupation
    Waterjet Programmer
    Discipline
    Manufacture
    Using
    AutoCAD 2012
    Join Date
    Dec 2015
    Location
    Dallas, Texas
    Posts
    82

    Default

    It has something to do with the shell command. I haven't gotten it working, but I haven't put much time into figuring it out either. If I understand correctly, this other thread does what you're wanting, but I can't make it work with Excel some reason.
    I just now discovered for the first time that I am prone to memory loss.

  6. #6
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,165

    Default

    Simply:
    Code:
    (if (setq excel (vlax-get-or-create-object "Excel.Application"))
      (vlax-put-property excel 'visible :vlax-true)
      (prompt "\nUnable to interfere with excel application.")
    )
    Although you would have to release the excel application object in the end.

    EDIT: Damn, Lee was faster - sorry.

  7. #7
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,368

    Default

    Actually, this is better:
    Code:
    (startapp (vl-registry-read (strcat "HKEY_CLASSES_ROOT\\" (vl-registry-read "HKEY_CLASSES_ROOT\\.xls") "\\shell\\new\\command")))
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  8. #8
    Full Member
    Using
    Civil 3D 2014
    Join Date
    Dec 2013
    Location
    Dallas, TX
    Posts
    74

    Default

    Thanks everyone! You guys are so awesome.

  9. #9
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,165

    Default

    Quote Originally Posted by Lee Mac View Post
    Actually, this is better:
    Code:
    (startapp (vl-registry-read (strcat "HKEY_CLASSES_ROOT\\" (vl-registry-read "HKEY_CLASSES_ROOT\\.xls") "\\shell\\new\\command")))
    Learned something new today, you have my thanks!

  10. #10
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,368

    Default

    Registered forum members do not see this ad.

    You're welcome!
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

Similar Threads

  1. Opening a Template file from Excel VBA
    By Bobkat in forum .NET, ObjectARX & VBA
    Replies: 1
    Last Post: 30th Nov 2012, 01:33 pm
  2. autocad excel coordinate to excel
    By ses4 in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 11th Apr 2011, 01:44 pm
  3. AutoCAD opens Excel when opening dwg with links
    By dwilcox13 in forum AutoCAD General
    Replies: 7
    Last Post: 3rd Nov 2009, 05:23 pm
  4. Automaticly load excel on opening drawing
    By Containing_Iron in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 12th Sep 2008, 06:54 pm
  5. Opening drawings through excel
    By geordieboy in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 16th Nov 2006, 03:23 pm

Bookmarks

Posting Permissions

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