Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function to perform on closing an Excel Workbook
I wish to automate the closing of an Excel workbook so that Excel does
not save any changes, but does save what has been copied to the clipboard. I have got as far as. ActiveWorkbook.Close and am stuck Any ideas? Many thanks. Kind regards PaddyMac |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function to perform on closing an Excel Workbook
Try this:
Sub Tester() Application.DisplayAlerts = False ActiveWorkbook.Close False Application.DisplayAlerts = True End Sub Tim "PaddyMac" wrote in message ... I wish to automate the closing of an Excel workbook so that Excel does not save any changes, but does save what has been copied to the clipboard. I have got as far as. ActiveWorkbook.Close and am stuck Any ideas? Many thanks. Kind regards PaddyMac |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function to perform on closing an Excel Workbook
1. where would you like the clipboard to be saved?
.... 2. to ignore saving changes do as follows: press ALT+F11 to get to VBA window then in Project-VBAProject double click on ThisWorkbook object select Workbook in a window where (General) is displayed select BeforeClose in the rightmost window Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.DisplayAlerts = False ActiveWorkbook.Close savechanges:=False End Sub On 15 Paź, 05:29, PaddyMac wrote: I wish to automate the closing of an Excel workbook so that Excel does not save any changes, but does save what has been copied to the clipboard. I have got as far as. ActiveWorkbook.Close and am stuck Any ideas? Many thanks. Kind regards PaddyMac |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function to perform on closing an Excel Workbook
Tim
I am so sorry for not responding sooner - your message has only just shown up. I'll try it out tomorrow morning Many thanks. Kind regards Ian "Tim Williams" wrote: Try this: Sub Tester() Application.DisplayAlerts = False ActiveWorkbook.Close False Application.DisplayAlerts = True End Sub Tim "PaddyMac" wrote in message ... I wish to automate the closing of an Excel workbook so that Excel does not save any changes, but does save what has been copied to the clipboard. I have got as far as. ActiveWorkbook.Close and am stuck Any ideas? Many thanks. Kind regards PaddyMac . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function to perform on closing an Excel Workbook
jaarek
Sorry for not responding sooner - your post has only just shown up. I'll try it tomorrow morning. many thanks! Kind regards PaddyMac "Jarek Kujawa" wrote: 1. where would you like the clipboard to be saved? .... 2. to ignore saving changes do as follows: press ALT+F11 to get to VBA window then in Project-VBAProject double click on ThisWorkbook object select Workbook in a window where (General) is displayed select BeforeClose in the rightmost window Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.DisplayAlerts = False ActiveWorkbook.Close savechanges:=False End Sub On 15 Paź, 05:29, PaddyMac wrote: I wish to automate the closing of an Excel workbook so that Excel does not save any changes, but does save what has been copied to the clipboard. I have got as far as. ActiveWorkbook.Close and am stuck Any ideas? Many thanks. Kind regards PaddyMac . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically perform action when closing Excel Worksheet | Excel Programming | |||
perform 1 function, stop, perform different function | Excel Discussion (Misc queries) | |||
close workbook without closing excel and stop recursive function | Excel Discussion (Misc queries) | |||
How to perform the following function in Excel? | Excel Worksheet Functions | |||
closing excel after closing a workbook | Excel Programming |