Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am running some automated reports and using a batch file to run them in
sequence, one issue I am having is forcing each report to close after it is complete, the command I am using is application.quit but this seems to be very flaky, is there a better way to force excel to close when the report is complete thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Application.Quit is the appropriate method of closing the application.
However, certain protocol should be followed in using it. Be sure that all files for that instance of the application are closed before before executing the Quit command. To avoid error or run time messages, when closing the files, establish their saved status. Either save them, use the Saved = True or SaveChanges = False to avoid the messages. A review of the VBA help file on these topics might provide additional assistance. "Nigel" wrote in message ... I am running some automated reports and using a batch file to run them in sequence, one issue I am having is forcing each report to close after it is complete, the command I am using is application.quit but this seems to be very flaky, is there a better way to force excel to close when the report is complete thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this at the end of the code
ThisWorkbook.Save application.Quit the workbook is saving but excel is not closing, if I do this thisworkbook.save thisworkbook.close and then on the before close event application.quit it seems to work fine "JLGWhiz" wrote: Application.Quit is the appropriate method of closing the application. However, certain protocol should be followed in using it. Be sure that all files for that instance of the application are closed before before executing the Quit command. To avoid error or run time messages, when closing the files, establish their saved status. Either save them, use the Saved = True or SaveChanges = False to avoid the messages. A review of the VBA help file on these topics might provide additional assistance. "Nigel" wrote in message ... I am running some automated reports and using a batch file to run them in sequence, one issue I am having is forcing each report to close after it is complete, the command I am using is application.quit but this seems to be very flaky, is there a better way to force excel to close when the report is complete thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you have more than one workbook Opened?
"Nigel" wrote: I have this at the end of the code ThisWorkbook.Save application.Quit the workbook is saving but excel is not closing, if I do this thisworkbook.save thisworkbook.close and then on the before close event application.quit it seems to work fine "JLGWhiz" wrote: Application.Quit is the appropriate method of closing the application. However, certain protocol should be followed in using it. Be sure that all files for that instance of the application are closed before before executing the Quit command. To avoid error or run time messages, when closing the files, establish their saved status. Either save them, use the Saved = True or SaveChanges = False to avoid the messages. A review of the VBA help file on these topics might provide additional assistance. "Nigel" wrote in message ... I am running some automated reports and using a batch file to run them in sequence, one issue I am having is forcing each report to close after it is complete, the command I am using is application.quit but this seems to be very flaky, is there a better way to force excel to close when the report is complete thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No its just the one, abatch file call each spreadsheet in turn
"Joel" wrote: Do you have more than one workbook Opened? "Nigel" wrote: I have this at the end of the code ThisWorkbook.Save application.Quit the workbook is saving but excel is not closing, if I do this thisworkbook.save thisworkbook.close and then on the before close event application.quit it seems to work fine "JLGWhiz" wrote: Application.Quit is the appropriate method of closing the application. However, certain protocol should be followed in using it. Be sure that all files for that instance of the application are closed before before executing the Quit command. To avoid error or run time messages, when closing the files, establish their saved status. Either save them, use the Saved = True or SaveChanges = False to avoid the messages. A review of the VBA help file on these topics might provide additional assistance. "Nigel" wrote in message ... I am running some automated reports and using a batch file to run them in sequence, one issue I am having is forcing each report to close after it is complete, the command I am using is application.quit but this seems to be very flaky, is there a better way to force excel to close when the report is complete thanks |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check you task maanger to make sure you don't have more than one workbook
opened. Is the batch file calling each batch file and there is a workbook open event so the macro in each workbook atumatically runs. The close will close the workbook and automatically stop the macro because the macro is part of the workbook that was closed leaving the application open. if you are saving the workbook then you don't want to close the workbook becasue the excel application will be left open. Instead just perform the quit which wil also close the workbook. "Nigel" wrote: No its just the one, abatch file call each spreadsheet in turn "Joel" wrote: Do you have more than one workbook Opened? "Nigel" wrote: I have this at the end of the code ThisWorkbook.Save application.Quit the workbook is saving but excel is not closing, if I do this thisworkbook.save thisworkbook.close and then on the before close event application.quit it seems to work fine "JLGWhiz" wrote: Application.Quit is the appropriate method of closing the application. However, certain protocol should be followed in using it. Be sure that all files for that instance of the application are closed before before executing the Quit command. To avoid error or run time messages, when closing the files, establish their saved status. Either save them, use the Saved = True or SaveChanges = False to avoid the messages. A review of the VBA help file on these topics might provide additional assistance. "Nigel" wrote in message ... I am running some automated reports and using a batch file to run them in sequence, one issue I am having is forcing each report to close after it is complete, the command I am using is application.quit but this seems to be very flaky, is there a better way to force excel to close when the report is complete thanks |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"flaky" ?
maybe add Application.DisplayAlerts = False before this line? "Nigel" wrote in message ... I am running some automated reports and using a batch file to run them in sequence, one issue I am having is forcing each report to close after it is complete, the command I am using is application.quit but this seems to be very flaky, is there a better way to force excel to close when the report is complete thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to force Excel wkbk to close | Excel Programming | |||
How to force close the worksheet without having Excel prompt? | Excel Programming | |||
How do you force excel to save on close | Excel Discussion (Misc queries) | |||
Is there a way to force Excel to close workbooks independently? | Excel Discussion (Misc queries) | |||
Macro to force Excel to close after a given timeframe of inactivit | Excel Programming |