Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 1st, 2006, 01:08 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default overwriting files

i added a workbook using VB in Excel by using the code:
Workbooks.add
and then saved it as another file with
ActiveWorkbook.saveAs("Filename.xls")

However, every time i run this script, a message comes up telling me that the file already exists.
Is there a way I can overwrite this file through Excel VB automatically? Does such a method exist in Excel vbe?
Reply With Quote
  #2 (permalink)  
Old August 1st, 2006, 01:14 PM
Authorized User
 
Join Date: Jul 2006
Location: , , Poland.
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Application.DisplayAlerts = False
ActiveWorkbook.saveAs("Filename.xls")
Application.DisplayAlerts = True

Reply With Quote
  #3 (permalink)  
Old August 1st, 2006, 02:53 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your help :)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Overwriting fields in a table caterpillar SQL Server 2000 3 July 24th, 2006 09:00 AM
overwriting data bryan.lugo Excel VBA 8 April 21st, 2006 01:59 PM
Generated Code Overwriting PWD rodmcleay ADO.NET 1 November 28th, 2005 04:27 AM
overwriting file ozPATT Excel VBA 0 October 14th, 2005 04:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.