Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto answer - "Do you wish to save changes"
Hi,
I have a script that copies a worksheet, creates a new workbook containing the copied sheet which is then printed. After printing the new workbook is closed The script is: ActiveSheet.Copy 'Next line prints out the new worksheet ActiveWorkbook.PrintOut 'Next line closes the workbook containing the copied worksheet ActiveWorkbook.Close Obviously when I close the new (and temporary) workbook I'm prompted with the question "Do I wish to save the changes to book 2?" Is it possible to get the script to effectively answer that question for me - so the question doesn't appear? -- Cheers Peter Remove the INVALID to reply |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto answer - "Do you wish to save changes"
Application.DisplayAlerts=False newbook.Saved=True newbook.Close this will close without attempting to sav -- crispb ----------------------------------------------------------------------- crispbd's Profile: http://www.excelforum.com/member.php...fo&userid=1088 View this thread: http://www.excelforum.com/showthread.php?threadid=31459 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto answer - "Do you wish to save changes"
Hi Peter
Use this if you not want to save the file ActiveWorkbook.Close False -- Regards Ron de Bruin http://www.rondebruin.nl "Peter" wrote in message ... Hi, I have a script that copies a worksheet, creates a new workbook containing the copied sheet which is then printed. After printing the new workbook is closed The script is: ActiveSheet.Copy 'Next line prints out the new worksheet ActiveWorkbook.PrintOut 'Next line closes the workbook containing the copied worksheet ActiveWorkbook.Close Obviously when I close the new (and temporary) workbook I'm prompted with the question "Do I wish to save the changes to book 2?" Is it possible to get the script to effectively answer that question for me - so the question doesn't appear? -- Cheers Peter Remove the INVALID to reply |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto answer - "Do you wish to save changes"
But why don't you use
ActiveSheet.PrintOut Instead of copy it first to a new workbook -- Regards Ron de Bruin http://www.rondebruin.nl "Peter" wrote in message ... Hi, I have a script that copies a worksheet, creates a new workbook containing the copied sheet which is then printed. After printing the new workbook is closed The script is: ActiveSheet.Copy 'Next line prints out the new worksheet ActiveWorkbook.PrintOut 'Next line closes the workbook containing the copied worksheet ActiveWorkbook.Close Obviously when I close the new (and temporary) workbook I'm prompted with the question "Do I wish to save the changes to book 2?" Is it possible to get the script to effectively answer that question for me - so the question doesn't appear? -- Cheers Peter Remove the INVALID to reply |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto answer - "Do you wish to save changes"
On Wed, 17 Nov 2004 23:35:12 +0100, "Ron de Bruin"
wrote: But why don't you use ActiveSheet.PrintOut Instead of copy it first to a new workbook I did it in the way I described because the workbook contains lots of sheets and i only wanted the one to be emailed (and printed) - Assumed that if I asked for a print that it would print all the sheets. Will try your suggestion. Many thanks -- Cheers Peter Remove the INVALID to reply |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto answer - "Do you wish to save changes"
On Wed, 17 Nov 2004 16:27:12 -0600, crispbd
wrote: Application.DisplayAlerts=False newbook.Saved=True newbook.Close this will close without attempting to save Hi, many thanks for your reply. -- Cheers Peter Remove the INVALID to reply |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto answer - "Do you wish to save changes"
On Wed, 17 Nov 2004 23:33:42 +0100, "Ron de Bruin"
wrote: Hi Peter Use this if you not want to save the file ActiveWorkbook.Close False Hi Ron, I've tried out your solution and it works perfectly - many thanks for taking the time to help -- Cheers Peter Remove the INVALID to reply |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto answer - "Do you wish to save changes"
sheets and i only wanted the one to be emailed
For a mail example look here http://www.rondebruin.nl/mail/folder1/mail2.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Peter" wrote in message ... On Wed, 17 Nov 2004 23:35:12 +0100, "Ron de Bruin" wrote: But why don't you use ActiveSheet.PrintOut Instead of copy it first to a new workbook I did it in the way I described because the workbook contains lots of sheets and i only wanted the one to be emailed (and printed) - Assumed that if I asked for a print that it would print all the sheets. Will try your suggestion. Many thanks -- Cheers Peter Remove the INVALID to reply |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 | Excel Discussion (Misc queries) | |||
How do I write an excel formula with a text answer ("yes" or "no") | Excel Discussion (Misc queries) | |||
How to schedule an auto "Save As" of an Excel spreadsheet daily... | Excel Worksheet Functions | |||
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION | Excel Discussion (Misc queries) | |||
"Save" and "Save As" options greyed out - "Save as Webpage" option | Excel Discussion (Misc queries) |