Excel 2016 file exclusive user restricted by VBA

kraaniks

New Member
Joined
Sep 19, 2016
Messages
26
Hi excel gurus,

Our consultants have made an excel file which I can't open, it says "file configured for exclusive user", my colleague who can open the file can't edit and see macros, they are also protected.

Could somebody help me to remove the "exclusive user rights" from the file, and remove the "macros edit" protection? I can send the file right away to you, or if you can please provide me instructions here.

I would really appreciate any help.

Br,
Edgars
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Put it to some cloud storage and send me a link.
 
Upvote 0
The problem is with the code which is fired when you open workbook. Here it is:
Code:
Private Sub Workbook_Open()
    Application.Visible = False
    On Error GoTo 10
    p = ActiveWorkbook.Path
    
    If InStrRev(p, "\14EM2386\", -1, vbTextCompare) > 0 _
        Or InStrRev(p, "\martins.muiznieks", -1, vbTextCompare) > 0 _
        Or InStrRev(p, "\ACR", -1, vbTextCompare) > 0 _
        Or InStrRev(p, "\BPO", -1, vbTextCompare) > 0 Then
        
        Application.Visible = True
        Exit Sub
    Else
        MsgBox "[COLOR=#ff0000]File is not configured for your use[/COLOR]", vbCritical, "ERROR"
        ActiveWorkbook.Close (False)
    End If
    
    Exit Sub
10:
    MsgBox "[COLOR=#ff0000]File is corrupted![/COLOR]", vbCritical, "ERROR"
    ActiveWorkbook.Close (False)
End Sub
In other words, there are some checks about workbook's location path, more specifically - the path must contain one of these strings: "14EM2386", "martins.muiznieks", "ACR" and "BPO".
 
Upvote 0
wow I am amazed you dig into something. Is it possible to remove this code, if it is used only for security purpose?
 
Upvote 0
Well, I got some bad news for you. I can remove this code, but I will have to save this workbook as Excel 97-2003 file format. There will lots of losses.
Here's the link with the file itself (in Excel 97-2003 format) and list of losses. Now it's up to you to fix those errors.
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,208
Members
448,874
Latest member
b1step2far

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