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

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,215,518
Messages
6,125,291
Members
449,218
Latest member
Excel Master

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