Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA, what is the command to EXIT the EXCEL PROGRAM!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
In my automatic macro, i want to exit the excel program automatically. what is the command to do this in vba?

Thank You
 

Try this:

Sub Macro1()
ActiveWorkbook.RunAutoMacros Which:=xlAutoClose
End Sub QUOTE OF THE DAY
I will prepare, and some day my chance will come.
Abraham Lincoln

<%
Jr_Clown :eek:)
%>
 
Well, what i meant was to exit the EXCEL.exe program not a macro.

What command would you use to do this?
 
To close the Excel application from a macro:
Code:
Application.DisplayAlerts = False
Application.Quit
 
I want to run a macro on save. The macro needs to check all cells that are 'numeric' and either change the format to 'general' or put a 'tick in front of the numeric expression.

The reasoning behind this is I use this file in a VB application, it opens the file, queries out the data I need and creates a text file, but when the user changes something in the excel file it resets my format. If anyone has a better idea of how to do this, I'm open for opinions.

Thanx,
Brandi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top