Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

.Parent.SaveAs Filename: Without Prompting To Replace File

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dean P. - 21 Nov 2007 17:25 GMT
How do I modify the current VBA script listed below to automatically
writeover the MATERIAL_ORDERS.xls file each time without prompting do you
have to replace this file.

Thanks so much for the help.



Set ActWkbk = ActiveWorkbook
 
  ActWkbk.Worksheets("MATERIAL ORDERS").Copy
  With ActiveSheet
     .Parent.SaveAs Filename:=ActWkbk.Path & "\" & "MATERIAL ORDERS.XLS"
  End With
crferguson@gmail.com - 21 Nov 2007 17:36 GMT
Just wrap an Application.DisplayAlerts=False around the saveas code.
Don't forget to toggle it back on immediately afterwards though!

Set ActWkbk = ActiveWorkbook

  ActWkbk.Worksheets("MATERIAL ORDERS").Copy
  Application.DisplayAlerts=False
  ActiveSheet.Parent.SaveAs Filename:=ActWkbk.Path & "\" & "MATERIAL
ORDERS.XLS"
  Application.DisplayAlerts=True

On Nov 21, 11:25 am, Dean P. <Dean P...@discussions.microsoft.com>
wrote:
> How do I modify the current VBA script listed below to automatically
> writeover the MATERIAL_ORDERS.xls file each time without prompting do you
[quoted text clipped - 8 lines]
>       .Parent.SaveAs Filename:=ActWkbk.Path & "\" & "MATERIAL ORDERS.XLS"
>    End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.