View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Macro to Close Files - getting past message

Just something you can test:

application.cutcopymode = false
workbooks("abc.xls").close savechanges:=false
workbooks("dfg.xls").close savechanges:=false
workbooks("ttt.xls").close savechanges:=false

It's just a guess. But I'd just use the workbooks collection if I'm closing the
file. And maybe (a big maybe), the problem is that there's too much junk in the
clipboard.

But maybe not, too...

Jack wrote:

i have written a macro for Excel 2003 to close a group of files. I'm not
trying to save any data just close the files. The files are fairly large and
i get message

Excel Cannot complete this taks with available resources. I press OK and
the files close. I would like to have the macro handle this for me. The
message only comes up on two of the files.

sub
Windows("abc.xls").Activate
ActiveWindow.Close
Windows("dfg.xls").Activate
ActiveWindow.Close
Windows("ttt.xls").Activate
ActiveWindow.Close
close sub


--

Dave Peterson