Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I'm reading/writing Excel data to SQL Server thru VBA. As such I do not
want to be prompted to save the data when closing down Excel. How can I do this? -- Thanks Glenn |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Glenn, try this:
Application.DisplayAlerts = False Workbooks("YourWorkbook.xls").Close Application.DisplayAlerts = True If you want to immediately close right out of Excel then replace the second line with Application.Quit. "Glenn Rathke (Soft Design Consulting)" wrote: I'm reading/writing Excel data to SQL Server thru VBA. As such I do not want to be prompted to save the data when closing down Excel. How can I do this? -- Thanks Glenn |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks for the info but unfortunately it does not work or I am missing
something else. If the user changes a cell in the spreadsheet, I do not want the message to appear asking them if they want to save the file when closing the workbook. Even with this code they user is prompted. Perhaps I implemented it incorrectly, I placed it in the before close event. Thanks Glenn Rathke "Glenn Rathke (Soft Design Consulting)" wrote in message ... I'm reading/writing Excel data to SQL Server thru VBA. As such I do not want to be prompted to save the data when closing down Excel. How can I do this? -- Thanks Glenn |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
This line of code does the trick, I put it in the BeforeClose event.
ThisWorkbook.Saved = True It tells the workbook that the most recent copy of the data has been saved (in actuality it has not) and that it is not dirty. Now when the close event is fired, the data does not appear that it has been changed. Glenn "Glenn Rathke (Soft Design Consulting)" wrote in message ... Thanks for the info but unfortunately it does not work or I am missing something else. If the user changes a cell in the spreadsheet, I do not want the message to appear asking them if they want to save the file when closing the workbook. Even with this code they user is prompted. Perhaps I implemented it incorrectly, I placed it in the before close event. Thanks Glenn Rathke "Glenn Rathke (Soft Design Consulting)" wrote in message ... I'm reading/writing Excel data to SQL Server thru VBA. As such I do not want to be prompted to save the data when closing down Excel. How can I do this? -- Thanks Glenn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to save data in CSV format when a field also contains comma? | Excel Discussion (Misc queries) | |||
Save 2 separate data imports in separate worksheets on the same ex | Excel Worksheet Functions | |||
consolidation of tables in excel with text and figures | Excel Worksheet Functions | |||
save prompt for user exit, but no save prompt for batch import? | Excel Discussion (Misc queries) | |||
From several workbooks onto one excel worksheet | Excel Discussion (Misc queries) |