Be the first user to complete this post

  • 0
Add to List

VBA-Excel: Open a Excel WorkBook

Using VBA (Visual Basic for Applications) , you can open Excel workbook at the runtime by using Open() method.

You have to provide the Complete Path along with the name of the Excel you want to open, it will return the object of that excel which you can use later to perform operations on it.

Function FnOpenWorkBook()

    Dim objWorkBook As Workbook

    Set objWorkBook = Workbooks.Open("C:\New folder\NewOpenBook.xlsx")

     objWorkBook.Sheets("Sheet1").Range("A1").Value = 5

End Function



Also Read:

  1. VBA-Excel: Add Worksheets For All The Given Dates Except Weekends and Copy The Common Template In Each Worksheet
  2. VBA-Excel: Copy/Paste data - Copy the Entire row data and paste it to another row
  3. VBA-Excel: Copy/Paste data - Copy the data from a call and paste it to another cell
  4. VBA-Excel: Get the names of all WorkSheets in a Excel (WorkBook)
  5. VBA Excel - Cells, Ranges and Offset: Refer to Cells by Using Shortcut Notation