Replacing XLS file rather than saving

  • Thread starter Thread starter FuzzyDove
  • Start date Start date
F

FuzzyDove

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
 
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
 
application.displayalerts=False
'do the save/overwrite
application.displayalerts=True



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


FuzzyDove wrote :
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top