Be the first user to complete this post
|Add to List|
VBA-Excel: Create a WorkBook at Runtime.
Using VBA (Visual Basic for Applications) , you can create Excel workbook at the runtime by using Add() method.
If you won’t provide any name for the workbook it will be created as BookN, where N will increase automatically, starting from 0, as you call WorkBook.Add() function.
Function FnCreateWorkBook() Dim objWorkBook As Workbook Set objWorkBook = Workbooks.Add objWorkBook.SaveAs Filename:="NewWorkBook.xls" End Function
.Add() method creates a workbook and return object of the that. Later on you can use that object to save it to specific location or other operations.
- Excel-VBA : Insert Multiple Images from a Folder to Excel Cells
- VBA-Excel: Convert Numbers (Rupees) into Words OR Text - Updated Till 1000000 Crore With Decimal Numbers
- Excel-VBA : Prevent Changing the WorkSheet Name
- VBA Excel – Refer to Multiple Ranges : Union Method
- VBA Codes - Record Macro
- VBA-Excel: Cells Ranges Offset - Active Cell
- VBA-Excel : 3D-Ranges – FillAcrossSheets Method
- VBA Excel - Cells, Ranges and Offset: Refer Range by using A1 Notations