Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

VBA-Excel: Open a Excel WorkBook

Using VBA (Visual Basic for Appli­ca­tions) , you can open Excel work­book at the run­time by using Open() method.

You have to pro­vide the Com­plete 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 per­form oper­a­tions 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

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: