read only warning issue

ajtilley

New Member
Joined
Jul 19, 2010
Messages
24
Hi i have a problem, i have a simple macro enabled button which loads a second workbook page, unfortunately if someone is already in the workbook it loads it skips the read only warning that states who is currently using the workbook and simply asks for the password and puts them into a read only format.

Is it possible to add an error code or if code that determines that another user is in the file and then tells the person who is in it and that it is going into a read only format.

(I attempted to make the macro a hyper link instead but unfortunately the hyperlink wont copy across the macro enabled settings which i need to make items in the new workbook operate correctly so i have to use a macro to open it)

My current code is:

<TABLE cellSpacing=0 cellPadding=6 width="100%" border=0><TBODY><TR><TD class=alt2 style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset">
Code:
Sub Litigation()
'
' Litigation Macro
'
'
Workbooks.Open Filename:="H:\Staff Returns\2010\Litigation.xlsm"
End Sub
</TD></TR></TBODY></TABLE>
Any help on this would be greatly appreciated as it is a necessary inclusion.

In addition i have noticed if they input the password incorrectly it doesnt bring up an error saying password is incorrect it instead tells them that the macro has had a problem is there code i can add that will provide an error message rather than the debug code?
<!-- / message --><!-- edit note -->
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,838
Messages
5,833,921
Members
430,244
Latest member
Ireland1

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