Thread: Sace and close
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ianripping[_35_] ianripping[_35_] is offline
external usenet poster
 
Posts: 1
Default Sace and close

I want to have a macro assigned to a button so that when the button is
pressed the current file is saved and then excel is exited.

I tried: -

Sub Closea()
ThisWorkbook.Save
Application.Select.Close
End Sub

But no good. Saving works but not close.

Sub Closea()
ThisWorkbook.Save
ThisWorkbook.Close
End Sub

Will close the workbook but not excel itself.
Any ideas?


---
Message posted from http://www.ExcelForum.com/