Helpl with some simple code

RJTools

New Member
Joined
Sep 14, 2006
Messages
43
I have a file where users add data to a file but I don’t want them to be able to work in it. I have a form feed this file. I would like to test to see if a file is currently in use. If it is let the user know to try later. However, since they shouldn’t open the file to work in it I don’t want them to be notified when it’s available. This is what I have but it always says the file is in use. Your help would be greatly appreciated.

'Check to see if the Data file is open
a = Range("Main!A63").Value
If Workbooks(a).ReadOnly = True Then
MsgBox ("Currently being updated. Please try later.")
Exit Sub
End If
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,136,349
Messages
5,675,243
Members
419,556
Latest member
rdecker12

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
Top