#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 594
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Highlight Range - wrong macro, please edit. Danny Excel Worksheet Functions 8 October 19th 05 11:11 PM


All times are GMT +1. The time now is 08:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"