SteveFairclough
IS-IT--Management
I have a simple macro that automatically starts when the spreadsheet is opened. I am desperately trying to get the macro to automatically close excel at the end. However, Excel will only quit when I'm stepping though the code to debug it, if I run the code normally then all the other code executes fine but when it gets to the Application.Quit line, excel just doesn't do anything. I'm using the "Application.DisplayAlerts = False" method to quit Excel without saving. A shortened version of my code is shown below :-
Sub Aut
pen()
'Main part of code goes here
Application.DisplayAlerts = False
'placing a Stop here and stepping though will then allow the following line to execute !!
Application.Quit
End Sub
Does anybody have any idea what is going on here ?
Many thanks
Steve Fairclough
I.T. Manager
Sub Aut
'Main part of code goes here
Application.DisplayAlerts = False
'placing a Stop here and stepping though will then allow the following line to execute !!
Application.Quit
End Sub
Does anybody have any idea what is going on here ?
Many thanks
Steve Fairclough
I.T. Manager