Results 1 to 5 of 5

Thread: closing excel application

  1. #1

    Thread Starter
    Addicted Member sweet_dreams's Avatar
    Join Date
    Apr 2005
    Location
    Poland, Lodz
    Posts
    189

    Resolved closing excel application

    hi all,

    Can you tell me how can I programatically close active excel application???

    thx in advance for your help

    regards,
    sweet_dreams
    Last edited by sweet_dreams; Nov 14th, 2005 at 12:59 PM.

  2. #2
    Addicted Member malik641's Avatar
    Join Date
    Sep 2005
    Location
    South Florida :-)
    Posts
    221

    Re: closing excel application

    Well if you know the workbook's name:
    VB Code:
    1. Sub CloseExcel()
    2. Application.Workbooks("Book2").Close
    3. End Sub
    Or if you send the Procedure the name:
    VB Code:
    1. Sub CloseExcel(wb As Workbook)
    2. Application.Workbooks(wb.Name).Close
    3. End Sub

    Hope this is what you were looking for




    If you find any of my posts of good help, please rate it

  3. #3
    Addicted Member malik641's Avatar
    Join Date
    Sep 2005
    Location
    South Florida :-)
    Posts
    221

    Re: closing excel application

    Oh yeah, and to close all workbooks (without saving)
    VB Code:
    1. Sub CloseExcel()
    2. With Application
    3.     .EnableEvents = False
    4.     .Workbooks.Close
    5.     .EnableEvents = True
    6. End With
    7. End Sub




    If you find any of my posts of good help, please rate it

  4. #4

    Thread Starter
    Addicted Member sweet_dreams's Avatar
    Join Date
    Apr 2005
    Location
    Poland, Lodz
    Posts
    189

    Re: closing excel application

    thx malik641 but I was looking for something else. I was looking for something like that:

    application.quite

    code above closes whole excel application

    but thx anyway

  5. #5
    Addicted Member malik641's Avatar
    Join Date
    Sep 2005
    Location
    South Florida :-)
    Posts
    221

    Re: closing excel application

    I thought there was an easier way.

    Glad to see you got it moving.




    If you find any of my posts of good help, please rate it

Posting Permissions

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



Click Here to Expand Forum to Full Width