Overwriting an Existing Workbook : Workbooks « Excel « VBA / Excel / Access / Word

VBA / Excel / Access / Word
1. Access
2. Application
3. Data Type
4. Data Type Functions
5. Date Functions
6. Excel
7. File Path
8. Forms
9. Language Basics
10. Math Functions
11. Outlook
12. PowerPoint
13. String Functions
14. Windows API
15. Word
16. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
VBA / Excel / Access / Word » Excel » Workbooks 
Overwriting an Existing Workbook
 
Sub add()
     Set myWorkbook1 = Workbooks.Add
     Application.DisplayAlerts = False
     myWorkbook1.SaveAs Filename:="C:\Data\SalesData1.xlsx"
     Application.DisplayAlerts = True
End Sub

 
Related examples in the same category
1. To select a Workbook object from the Workbooks Collection object
2. To avoid confusion, you can select a workbook unambiguously- if you know the name of the desired Workbook object
3. When you need to step through several objects in a collection, use a loop and a looping variable to represent the index of the object to be returned.
4. Work your way through the entire object hierarchy to set one property
5. Creating a New Blank Workbook
6. Stores the current SheetsInNewWorkbook property, sets the SheetsInNewWorkbook property to 12, creates a new workbook (with those 12 worksheets), and then restores the SheetsInNewWorkbook setting to its previous value
7. Values for the UpdateLinks Argument
8. Opens the workbook named Plan.xls stored in the D:\Planning folder, providing the password for opening the workbook
9. Opens the text file named Data13.txt in the folder z:\transfer using an exclamation point (!) as the delimiter character
10. Closing All Open Workbooks
11. Sharing a Workbook
12. Declare a Workbook object variable and assign the ActiveWorkbook object to it, so that subsequent code can work with the object variable:
13. Working with Worksheets to add a worksheet
14. Copying or Moving a Worksheet
15. Moves the worksheet named Homes from the workbook named Planning.xls to the workbook named Building Schedule.xls, inserting the worksheet before the first existing worksheet in the workbook
16. Prints the first two pages of the worksheet named Summary in the workbook named Planning.xls to a file named Planning Summary.prn in the network folder \\server\to_print:
17. Returns the text in the active cell in the first window open on the workbook named Planning.xls:
18. Creating a Named Range from Workbooks
19. Deleting a Named Range
20. To apply a read-only recommendation to a workbook, set its ReadOnlyRecommended property to True
21. Activating a Window
22. Arranging and Resizing Windows
23. Use For...Next loop through Workbooks
24. Add Workbooks and save it as a new file
25. Use the return value of the Add method to create an object variable that refers to the new workbook
26. The Add method allows you to specify a template for the new workbook.
27. To add an existing workbook file to the Workbooks collection, you use the Open method
28. Getting a Filename from a Path
29. To see if the workbook is already a member of the Workbooks collection
30. Activate Workbook
31. Files in the Same Directory
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.