Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Excel
123quattro
charting
crashesgpfs
datamap
excel
interopoledde
links
misc
newusers
printing
programming
querydao
sdk
setup
templates
worksheet.functions
  
 
date: Tue, 26 Aug 2008 05:54:50 -0700 (PDT),    group: microsoft.public.excel        back       


Macro: Closing files without saving   
Hey guys
I'm trying to pull together data from several workbooks.
To do this I have to modify every submitting workbook (show hidden
columns etc). There are apx 100 subsequent submitting files to open,
processing and close
In the macro I open the files as "read only" to prevent unwanted
actions.

My problem is that a message "Will you save this file" appears at
the
ActiveWorkbook.Close macro VBA statement when the file is to close
after ended action.
Of course I can push the "no" button every singel time - but I expect
the must be a way to make my macro close the file without saving it
and without messaging.

All the rest of my macro seems to work well.

Will any one "out there" please give me some exact advice to eliminate
this problem?

Best regards
Snoopy
date: Tue, 26 Aug 2008 05:54:50 -0700 (PDT)   author:   Snoopy

Re: Macro: Closing files without saving   
try:

ActiveWorkbook.Close savechanges:=false



Snoopy wrote:
> 
> Hey guys
> I'm trying to pull together data from several workbooks.
> To do this I have to modify every submitting workbook (show hidden
> columns etc). There are apx 100 subsequent submitting files to open,
> processing and close
> In the macro I open the files as "read only" to prevent unwanted
> actions.
> 
> My problem is that a message "Will you save this file" appears at
> the
> ActiveWorkbook.Close macro VBA statement when the file is to close
> after ended action.
> Of course I can push the "no" button every singel time - but I expect
> the must be a way to make my macro close the file without saving it
> and without messaging.
> 
> All the rest of my macro seems to work well.
> 
> Will any one "out there" please give me some exact advice to eliminate
> this problem?
> 
> Best regards
> Snoopy

-- 

Dave Peterson
date: Tue, 26 Aug 2008 08:19:09 -0500   author:   Dave Peterson

Re: Macro: Closing files without saving   
Try putting this line before you close the file:

    Application.DisplayAlerts = False

and this one after:

    Application.DisplayAlerts = True

Hope this helps.

Pete

On Aug 26, 1:54 pm, Snoopy  wrote:
> Hey guys
> I'm trying to pull together data from several workbooks.
> To do this I have to modify every submitting workbook (show hidden
> columns etc). There are apx 100 subsequent submitting files to open,
> processing and close
> In the macro I open the files as "read only" to prevent unwanted
> actions.
>
> My problem is that a message "Will you save this file" appears at
> the
> ActiveWorkbook.Close macro VBA statement when the file is to close
> after ended action.
> Of course I can push the "no" button every singel time - but I expect
> the must be a way to make my macro close the file without saving it
> and without messaging.
>
> All the rest of my macro seems to work well.
>
> Will any one "out there" please give me some exact advice to eliminate
> this problem?
>
> Best regards
> Snoopy
date: Tue, 26 Aug 2008 06:21:16 -0700 (PDT)   author:   Pete_UK

Re: Macro: Closing files without saving   
On 26 Aug, 15:21, Pete_UK  wrote:
> Try putting this line before you close the file:
>
>     Application.DisplayAlerts = False
>
> and this one after:
>
>     Application.DisplayAlerts = True
>
> Hope this helps.
>
> Pete
>
> On Aug 26, 1:54 pm, Snoopy  wrote:
>
>
>
> > Hey guys
> > I'm trying to pull together data from several workbooks.
> > To do this I have to modify every submitting workbook (show hidden
> > columns etc). There are apx 100 subsequent submitting files to open,
> > processing and close
> > In the macro I open the files as "read only" to prevent unwanted
> > actions.
>
> > My problem is that a message "Will you save this file" appears at
> > the
> > ActiveWorkbook.Close macro VBA statement when the file is to close
> > after ended action.
> > Of course I can push the "no" button every singel time - but I expect
> > the must be a way to make my macro close the file without saving it
> > and without messaging.
>
> > All the rest of my macro seems to work well.
>
> > Will any one "out there" please give me some exact advice to eliminate
> > this problem?
>
> > Best regards
> > Snoopy– Skjul sitert tekst –
>
> – Vis sitert tekst –

Thanks a lot :)
date: Tue, 26 Aug 2008 06:28:35 -0700 (PDT)   author:   Snoopy

Re: Macro: Closing files without saving   
On 26 Aug, 15:19, Dave Peterson  wrote:
> try:
>
> ActiveWorkbook.Close savechanges:=false
>
>
>
>
>
> Snoopy wrote:
>
> > Hey guys
> > I'm trying to pull together data from several workbooks.
> > To do this I have to modify every submitting workbook (show hidden
> > columns etc). There are apx 100 subsequent submitting files to open,
> > processing and close
> > In the macro I open the files as "read only" to prevent unwanted
> > actions.
>
> > My problem is that a message "Will you save this file" appears at
> > the
> > ActiveWorkbook.Close macro VBA statement when the file is to close
> > after ended action.
> > Of course I can push the "no" button every singel time - but I expect
> > the must be a way to make my macro close the file without saving it
> > and without messaging.
>
> > All the rest of my macro seems to work well.
>
> > Will any one "out there" please give me some exact advice to eliminate
> > this problem?
>
> > Best regards
> > Snoopy
>
> --
>
> Dave Peterson– Skjul sitert tekst –
>
> – Vis sitert tekst –

Thanks to you both - it really did the job :)
date: Tue, 26 Aug 2008 06:29:07 -0700 (PDT)   author:   Snoopy

Re: Macro: Closing files without saving   
You're welcome - thanks for feeding back.

Pete

On Aug 26, 2:28 pm, Snoopy  wrote:

>
> Thanks a lot
date: Tue, 26 Aug 2008 06:39:54 -0700 (PDT)   author:   Pete_UK

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us