This is also related to below queries:
- excel vba open file dialog
- vba workbook open event
- excel vba open files in folder
- vba open workbook from path
- 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:
- There are other methods. It depends on your creativity and requirements
- Above codes are meeting almost all projects
No comments:
Post a Comment