LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Close file without saving


Hi all,

I'm having a problem with closing a file without the message 'Do yo
want to save the changes, Yes/No/Cancel'.
What's my problem? Well, I had a file containing a macro that had t
open a couple of files, one at a time, look for a value in a cell, an
depending on that value, close the file immediately or first perfor
some actions, copy some cells to the mainfile and close the file
Without changes. And then the next file and so on. I had the comman
'Application.DisplayAlerts = False' in the macro and it always worke
without any problems.
I haven't used this macro in a year, but now I want to use this macr
for another Network Drive (another location of the sourcefiles). Thes
files open Read-Only.
However, when I run the macro, I get the message 'Do you want to sav
changes?' when the macro closes a file where some cells are copied an
pasted.

Now, it isn't really a big problem, because I guess it could work i
the macro copies the worksheet first to the mainfile and closes th
sourcefile. Probably then the macro will consider the sourcefile a
not-changed. But before I'm changing the macro, I would like to know i
there's anyone who has experienced the same.

Here's what I've tried so far:
Application.DisplayAlerts = False
ThisWorkbook.Saved = True
Workbooks(sourcefilename).Close SaveChanges:=False

But nevertheless, I still get the 'Change? Yes/No/Cancel'-messages. An
then, it doesn't really matter what option I choose (Yes or No), becaus
Excel doesn't close the file anyway. Since the macro has to handle som
tens/hundreds of files, that's really annoying. Furthermore, the macr
crashes because the activeworkbook is the file that should be closed.
could easily fix that too, I know.

What's really the problem is that I can't stand it that Excel keep
showing the message, even though I put the displayalerts off, an
refuses to close the file. Is it because the files open Read-Only, o
is it that I have another Excelversion? Has anyone of you experience
the same and does anyone know what to do about it?

Regards,

Anne

--
Roadi
-----------------------------------------------------------------------
Roadie's Profile: http://www.excelforum.com/member.php...nfo&userid=593
View this thread: http://www.excelforum.com/showthread.php?threadid=27153

 
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
If I close a file without saving changes, can I get the autosaved jimp Excel Discussion (Misc queries) 0 July 31st 09 01:20 AM
File/Close automatically saving changes without prompt Joe@SAA Excel Discussion (Misc queries) 0 June 23rd 08 10:31 PM
Am i the first person to close and excel file, without saving chan Cjbrad Excel Discussion (Misc queries) 3 March 2nd 06 07:58 PM
Excel 2003: File->Close without saving changes (save menu does no. Wai-Yee Excel Discussion (Misc queries) 5 July 25th 05 11:49 PM
Close file without saving data ExcelMonkey[_96_] Excel Programming 2 March 2nd 04 11:34 PM


All times are GMT +1. The time now is 06:03 AM.

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"