read only warning issue


New Member
Jul 19, 2010
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">
Sub Litigation()
' Litigation Macro
Workbooks.Open Filename:="H:\Staff Returns\2010\Litigation.xlsm"
End Sub
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 -->

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Latest member

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...