Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I would like to automatically close a file without saving using a macro. Any
suggestions? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dim wkbk as workbook
Set wkbk = workbooks("someworkbooknameherethat'salreadyopen.x ls") wkbk.close savechanges:=false dwake wrote: I would like to automatically close a file without saving using a macro. Any suggestions? -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You can record a macro that will copy all of the movements. To record the
macro, go to Tools == Macro == Record Macro. That will pull up the Record Macro window, name your macro, and give it a shortcut key if you want. Once you hit ok, all of your movements will be recorded until you hit the stop macro button. All you need to do is close the file without saving and stop the macro. "dwake" wrote: I would like to automatically close a file without saving using a macro. Any suggestions? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Might be a good idea to record the macro in some other workbook than the one
you're closing without saving<g When you record to new workbook all you get from the recorder is Sub Macro3() ActiveWorkbook.Close End Sub Which closes the original workbook with a "do you want to save" message. So you would have to add the bits that Dave posted. Gord Dibben MS Excel MVP On Tue, 1 Dec 2009 16:10:01 -0800, Bryan wrote: You can record a macro that will copy all of the movements. To record the macro, go to Tools == Macro == Record Macro. That will pull up the Record Macro window, name your macro, and give it a shortcut key if you want. Once you hit ok, all of your movements will be recorded until you hit the stop macro button. All you need to do is close the file without saving and stop the macro. "dwake" wrote: I would like to automatically close a file without saving using a macro. Any suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Save File to specific location when closing | Excel Discussion (Misc queries) | |||
How to skip the save file notoification on file closing? | Excel Worksheet Functions | |||
How to code on Macro on saving and closing a file? | Excel Worksheet Functions | |||
macro closing worksheet | Excel Discussion (Misc queries) | |||
Help with auto macro on closing | Excel Discussion (Misc queries) |