+ Reply to Thread
Results 1 to 3 of 3

Automating Excel

  1. #1
    John
    Guest

    Automating Excel

    I am having problems automating Excel. I use Excel to
    display and print a table from AutoCAD. From a user form
    in AutoCAD I create an excel process and create the table,
    then I make Excel application visible. The user form is
    then unloaded and the object references to Excel are set
    to nothing. Now, my problem is that I can't find the best
    way to terminate the excel process. I want the user to
    close and terminate Excel after printing. Right now it
    always leaves the process running. Can someone tell me
    which is the best way to do this? Should I start and
    terminate Excel from the user form? TIA.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello John,

    Since you start Excel fromthe Form, you should terminate Excel from the Form. Add the following code to your Form where appropriate.

    Excel.Application.Quit

    This will terminate Excel in an orderly fashion.

    Hope this helps,
    Leith Ross

  3. #3
    Fredrik Wahlgren
    Guest

    Re: Automating Excel


    "John" <[email protected]> wrote in message
    news:[email protected]...
    > I am having problems automating Excel. I use Excel to
    > display and print a table from AutoCAD. From a user form
    > in AutoCAD I create an excel process and create the table,
    > then I make Excel application visible. The user form is
    > then unloaded and the object references to Excel are set
    > to nothing. Now, my problem is that I can't find the best
    > way to terminate the excel process. I want the user to
    > close and terminate Excel after printing. Right now it
    > always leaves the process running. Can someone tell me
    > which is the best way to do this? Should I start and
    > terminate Excel from the user form? TIA.


    Use Application.Quit



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1