sspatriots
Well-known Member
- Joined
- Nov 22, 2011
- Messages
- 585
- Office Version
- 365
- Platform
- Windows
Hi,
This is similar to a previous post, except it is a question on opening several files as ReadOnly when I open the workbook. I open all four of the files below when I launch this one workbook using the "Workbook_Open" event. The problem is one of these files stops the code with a message that says:
'The author would like you to open 'Production Schedule.xlsm' as read-only unless you need to make changes. Open as read-only?
I realize this is a setting on that file, but if my code below is telling it to open as "ReadOnly" why would it ask me that question anyway. I'd like to prevent that from popping up as I'm opening this file. I tried turning off ".Displayalerts" before this line in the code, but the message still pops up. Any thoughts on how to prevent this without telling the owner of the other file to turn that recommendation off would be greatly appreciated.
Thanks, SS
This is similar to a previous post, except it is a question on opening several files as ReadOnly when I open the workbook. I open all four of the files below when I launch this one workbook using the "Workbook_Open" event. The problem is one of these files stops the code with a message that says:
'The author would like you to open 'Production Schedule.xlsm' as read-only unless you need to make changes. Open as read-only?
I realize this is a setting on that file, but if my code below is telling it to open as "ReadOnly" why would it ask me that question anyway. I'd like to prevent that from popping up as I'm opening this file. I tried turning off ".Displayalerts" before this line in the code, but the message still pops up. Any thoughts on how to prevent this without telling the owner of the other file to turn that recommendation off would be greatly appreciated.
Thanks, SS
VBA Code:
file_path1 = "H:\Jobs\PO Block History.xlsm"
file_path2 = "G:\Manufacturing\Manufacturing Detail Schedule1.xlsx"
file_path3 = "H:\Shop Files\MRL Production Schedule\Production Schedule.xlsm"
file_path4 = "H:\Jobs\00 ENGINEERING DATA\Job List.xlsm"
Set my_wb1 = Workbooks.Open(Filename:=file_path1, ReadOnly:=True)
Set my_wb2 = Workbooks.Open(Filename:=file_path2, ReadOnly:=True)
Set my_wb3 = Workbooks.Open(Filename:=file_path3, ReadOnly:=True)
Set my_wb4 = Workbooks.Open(Filename:=file_path4, ReadOnly:=True)