Opening a read only workbook in Excel 2010 with VBA

TheDugginator

New Member
Joined
Jul 18, 2012
Messages
13
I have some code I have written that is basically supposed to open a read only copy of an Excel 2010 workbook. It then leaves it open for a period of time (long enough for a running Powerpoint slideshow to update linked data) and then closes it without attempting to save, then loop. Very simple right? Should be. But I started getting occasional blip where the the code is attempting to open a read only copy of the file but even after the instruction which specifically requests a read only copy, I get the pop up window asking me if I want to "Open a Read only copy, Notify, or Cancel". We of course, code stops and updating stops. What can I do?
Sub Updater()
'
If Workbooks.Count > 1 Then
Workbooks("WO Data Xtractor Template.xlsm").Close SaveChanges:=False
Else
End If
Workbooks.Open FileName:="\\tbbc2-me1\share\share\Departmental Board Metrics\WO Data Xtractor Tools\WO Data Xtractor Template.xlsm", ReadOnly:=True
Application.OnTime Now + TimeSerial(0, 45, 0), "Closer"

End Sub
Sub Closer()
If Workbooks.Count > 1 Then
Workbooks("WO Data Xtractor Template.xlsm").Close SaveChanges:=False
Else
End If
Application.OnTime Now + TimeSerial(0, 1, 0), "Updater"

End Sub

If the code which runs smoothly most of the time, is specifically requesting a read only copy, then why the pop up as if it was not specified? Help please.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,215,125
Messages
6,123,193
Members
449,090
Latest member
bes000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top