Stop searching. Start learning and developing your excel skills.
Macro
VBA
Formula
Function
Shortcut
Tricks

» » VBA To Open Workbooks

VBA To Open Workbooks

June 03, 2017 |
This is also related to below queries:
  1. excel vba open file dialog
  2. vba workbook open event
  3. excel vba open files in folder
  4. vba open workbook from path
  5. excel vba open workbook read only
The Code:
YourWorkbook = "C\Desktop\Book1.xlsx"
'''' I always set all required workbooks in my module so easier for me to call later. To open or close anytime
Workbooks.Open Filename:=YourWorkbook
'''' Open
Workbooks.Open Filename:=YourWorkbook , ReadOnly:=True
'''' Open as read-only in case other people is opening the workbook
Workbooks.Open Filename:=YourWorkbook , Password:="123", ReadOnly:=True
''' Open workbook with password, and read-only in case other people is opening the workbook
Tips:
  1. There are other methods. It depends on your creativity and requirements
  2. Above codes are meeting almost all projects

No comments:

Post a Comment