Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro help
Dear All
I have a macro which opens a temporary excel file modifies some data copies and pastes into another file from where i call this macro and closes the temporary file. At this point it stops and pops up a window do you want to save this file since i have modified this file this being a temporary file which I overwrite every time i dont need to save but unless i press Yes or No the macro won't move further. How do we avoid this? I know the answer may be simple But i create macros by recording tool and not by directly writing in VB editor. My main intention is to close the file without saving but shouldnot wait for user input to do so. Please Help Manju |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro help
Just make Excel THINK the file has been already saved:
Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.ThisWorkbook.Saved = True End Sub This goes in ThisWorkbook code -- Gary''s Student gsnu200703 "Manju" wrote: Dear All I have a macro which opens a temporary excel file modifies some data copies and pastes into another file from where i call this macro and closes the temporary file. At this point it stops and pops up a window do you want to save this file since i have modified this file this being a temporary file which I overwrite every time i dont need to save but unless i press Yes or No the macro won't move further. How do we avoid this? I know the answer may be simple But i create macros by recording tool and not by directly writing in VB editor. My main intention is to close the file without saving but shouldnot wait for user input to do so. Please Help Manju |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro help
Application.DisplayAlerts = False 'shuts off the pop-ups
Put your SAVE code here............... Application.DisplayAlerts = True 'turns things back to normal Application.Quit hth Vaya con Dios, Chuck, CABGx3 "Manju" wrote in message oups.com... Dear All I have a macro which opens a temporary excel file modifies some data copies and pastes into another file from where i call this macro and closes the temporary file. At this point it stops and pops up a window do you want to save this file since i have modified this file this being a temporary file which I overwrite every time i dont need to save but unless i press Yes or No the macro won't move further. How do we avoid this? I know the answer may be simple But i create macros by recording tool and not by directly writing in VB editor. My main intention is to close the file without saving but shouldnot wait for user input to do so. Please Help Manju |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro help
Manju
With Activeworkbook 'assuming this is the temporary file .Saved = True 'does not save changes .Close End with Gord Dibben MS Excel MVP On 31 Jan 2007 15:57:26 -0800, "Manju" wrote: Dear All I have a macro which opens a temporary excel file modifies some data copies and pastes into another file from where i call this macro and closes the temporary file. At this point it stops and pops up a window do you want to save this file since i have modified this file this being a temporary file which I overwrite every time i dont need to save but unless i press Yes or No the macro won't move further. How do we avoid this? I know the answer may be simple But i create macros by recording tool and not by directly writing in VB editor. My main intention is to close the file without saving but shouldnot wait for user input to do so. Please Help Manju |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro help
Thanks!
This worked. On Feb 1, 6:10 am, Gord Dibben <gorddibbATshawDOTca wrote: Manju With Activeworkbook 'assuming this is the temporary file .Saved = True 'does not save changes .Close End with Gord Dibben MS Excel MVP On 31 Jan 2007 15:57:26 -0800, "Manju" wrote: Dear All I have a macro which opens a temporary excel file modifies some data copies and pastes into another file from where i call this macro and closes the temporary file. At this point it stops and pops up a window do you want to save this file since i have modified this file this being a temporary file which I overwrite every time i dont need to save but unless i press Yes or No the macro won't move further. How do we avoid this? I know the answer may be simple But i create macros by recording tool and not by directly writing in VB editor. My main intention is to close the file without saving but shouldnot wait for user input to do so. Please Help Manju- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Highlight Range - wrong macro, please edit. | Excel Worksheet Functions |