Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Replacing XLS file rather than saving


I'm working on a little bit VBA that, one by one, opens hundreds o
existing xls files, compares the sheet names then adds some sheets o
new data as needed. It then re-saves (replaces) the original file wit
the one that has the new sheets of data. The problem that I desparatel
need help with, is that every time it goes to save the file, Excel pop
up a box asking me if I want to replace the existing file (which clearl
I do). However, this needs to be an automated process so I can't si
there for 3 hours clicking yes to each of the hundreds of files. Doe
anybody know how I can get VBA/Excel to replace the file without bein
prompted each time?? (by the way, the SaveChanges does not help suc
as: Workbooks("BOOK1.XLS").Close SaveChanges:=True does not help).
Thanks HEAPS for any suggestions or help!!
FuzzyDov

--
FuzzyDov
-----------------------------------------------------------------------
FuzzyDove's Profile: http://www.excelforum.com/member.php...fo&userid=1667
View this thread: http://www.excelforum.com/showthread.php?threadid=31889

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Replacing XLS file rather than saving

Try turning off alerts. E.g.,

Application.DisplayAlerts = False
' your code here
Application.DisplayAlerts = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"FuzzyDove" wrote in
message ...

I'm working on a little bit VBA that, one by one, opens
hundreds of
existing xls files, compares the sheet names then adds some
sheets of
new data as needed. It then re-saves (replaces) the original
file with
the one that has the new sheets of data. The problem that I
desparately
need help with, is that every time it goes to save the file,
Excel pops
up a box asking me if I want to replace the existing file
(which clearly
I do). However, this needs to be an automated process so I
can't sit
there for 3 hours clicking yes to each of the hundreds of
files. Does
anybody know how I can get VBA/Excel to replace the file
without being
prompted each time?? (by the way, the SaveChanges does not
help such
as: Workbooks("BOOK1.XLS").Close SaveChanges:=True does not
help).
Thanks HEAPS for any suggestions or help!!
FuzzyDove


--
FuzzyDove
------------------------------------------------------------------------
FuzzyDove's Profile:
http://www.excelforum.com/member.php...o&userid=16676
View this thread:
http://www.excelforum.com/showthread...hreadid=318894



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Replacing XLS file rather than saving



application.displayalerts=False
'do the save/overwrite
application.displayalerts=True



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


FuzzyDove wrote :


I'm working on a little bit VBA that, one by one, opens hundreds of
existing xls files, compares the sheet names then adds some sheets of
new data as needed. It then re-saves (replaces) the original file
with the one that has the new sheets of data. The problem that I
desparately need help with, is that every time it goes to save the
file, Excel pops up a box asking me if I want to replace the existing
file (which clearly I do). However, this needs to be an automated
process so I can't sit there for 3 hours clicking yes to each of the
hundreds of files. Does anybody know how I can get VBA/Excel to
replace the file without being prompted each time?? (by the way, the
SaveChanges does not help such as: Workbooks("BOOK1.XLS").Close
SaveChanges:=True does not help). Thanks HEAPS for any suggestions
or help!! FuzzyDove

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Replacing XLS file rather than saving

Try rapping...
Application.DisplayAlerts = False 'turn warnings off
and
Application.DisplayAlerts = True 'turn warnings on
around the code that replaces the file.
HTH,
Gary Brown


"FuzzyDove" wrote:


I'm working on a little bit VBA that, one by one, opens hundreds of
existing xls files, compares the sheet names then adds some sheets of
new data as needed. It then re-saves (replaces) the original file with
the one that has the new sheets of data. The problem that I desparately
need help with, is that every time it goes to save the file, Excel pops
up a box asking me if I want to replace the existing file (which clearly
I do). However, this needs to be an automated process so I can't sit
there for 3 hours clicking yes to each of the hundreds of files. Does
anybody know how I can get VBA/Excel to replace the file without being
prompted each time?? (by the way, the SaveChanges does not help such
as: Workbooks("BOOK1.XLS").Close SaveChanges:=True does not help).
Thanks HEAPS for any suggestions or help!!
FuzzyDove


--
FuzzyDove
------------------------------------------------------------------------
FuzzyDove's Profile: http://www.excelforum.com/member.php...o&userid=16676
View this thread: http://www.excelforum.com/showthread...hreadid=318894


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
Replacing a password protected file. JEV Excel Discussion (Misc queries) 1 March 26th 09 01:08 PM
What cause the file size increase by replacing $L with $U? Eric Excel Discussion (Misc queries) 0 September 4th 07 03:44 AM
Replacing all references to a file, with a new file name. Lots!! phil Excel Worksheet Functions 1 May 10th 07 04:33 PM
replacing contents of a cell with data froma list/file Andy T Excel Worksheet Functions 4 March 18th 07 08:09 AM
Hexadecimal File Replacing excel file E.Q. Excel Discussion (Misc queries) 1 February 24th 07 01:57 PM


All times are GMT +1. The time now is 07:28 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"