Unprotect or remove Bloomberg BbgResearchPubStorageWorksheet in Excel workbook - excel

Excel workbooks that have used the Bloomberg Add-In contain a hidden protected sheet called BbgResearchPubStorageWorksheet. The fact that sheet is protected prevents certain functions from being performed on the workbook – e.g., deleting custom styles. How can that worksheet be unprotected or removed from the workbook?
Unprotecting from the File >> Info menu claims to require a password, as shown in this screenshot:
(So far nobody in Bloomberg support has admitted that they have anything to do with this worksheet, so they can't provide the password to unprotect it.)
BbgResearchPubStorageWorksheet also appears in the Excel Objects list, but cannot be removed from the VBA editor:
How can we unprotect or remove this BbgResearchPubStorageWorksheet?
(One kludge would be to copy everything else in the workbook into a new workbook, but for a complicated workbook is becomes very tricky to preserve all references, names, and VB code in that process.)

First expose the sheet by going to its properties in the VBA editor and changing its Visible property from xlSheetVeryHidden to xlSheetVisible:
Now the worksheet will be visible and it can be deleted, even without knowing the password that was applied to protect it.

Related

Worksheet-level macros in Excel

I have some macros stored in worksheet module in an Excel file.
I protect the whole VBA Project with a password so the code cannot be seen.
But if that worksheet is moved or copied to another workbook, the code becomes visible without any passwords required.
Is there a solution for this?
I am deliberately putting my macros into a worksheet module because I want users to copy this worksheet into their files and work with the macros. But I want to keep them locked for viewing.

Code for the protection of worksheets - unable to be viewed without password for the specific sheet

I'm currently trying to construct a Workbook consisting of several Worksheets. However, the worksheets should be protected in a way so that they can't be opened unless the correct password is given. Ideally each worksheet should have its own password, i.e. if I were to click on say 'Sheet 2' I would have to enter a password in order to actually see the content of that sheet. I'm quite new to VBA and don't even know if this is even possible.
I have tried to solve the problem without VBA, but Excel does not have that kind of feature and only allows for the protection of cells, etc.

Protecting/Un-protecting worksheet in shared workbook with VBA

I am wanting to put a notes section into a workbook, where notes can be added about a particular row in a worksheet. There will be lots of rows.
I want these notes to be uneditable once they have been written, so they can't be tampered with.
Previously I have done this by unprotecting, then protecting the worksheet to enter the note which is captured in VBA. However this workbook needs to be shared, which means you can't unprotect or protect a workbook either in VBA or manually.
Excel really isn't the right platform for this, as it's basically a small CRM, but unfortunately for the moment it's the only thing available and that can't change for now, so need to try and find a way to make it work, any idea's?
I have tried protecting the workbook with UserInterfaceOnly:= True, and that works great until the workbook is closed and re-opened then it fails and then can't unprotect or protect the workbook.

Excel VBA: Lock cells without protecting the workbook

I have created an add-in that sends and retrieves data from a database in order for this data to be used by our analysts.
To prevent changes made to existing data points I want to lock the cells containing this data. Initially, I did this by locking the range of the data and protecting the workbook, since otherwise the locking does not work. However, protecting the workbook also removes/limits a lot of functionality for the end-user, such as creating graphs, the auto fill function, changing the format etc. Since these and other functionalities are needed for the end-user, I cannot protect the workbook. Still, I want to lock the cell containing the data points.
So my question is, is it possible to lock the cells in a dynamic range (I have macros detecting the correct end column and end row of the data points) without protecting the workbook? If so, how? If not, would it be possible to detect changes in the dynamic range and show a messagebox that changes are not allowed in this specific cell/range and revert back to the old value of the cell? If so, how?
I have seen a few posts asking a similar question, but these were either not answered or the answer was not satisfying for my case (e.g. a macro implemented in the VBA project of the workbook instead of the VBA project of the add-in).
Thanks in advance for your answer(s)!
Kind regards,
Robbert
Use
ActiveSheet.Cells.Locked=False
Then Lock your range which you don't want to be edited using:
Range("A1:A4").Cells.Locked=True
Then protect the sheet
ActiveSheet.Protect Contents:=True, DrawingObjects:=False
This will only protect the contents that are Locked and still allow you to change values in the rest of the sheet and insert/delete charts. You may have to change extra settings with Protect. More details can be found here
You don't have to protect the Workbook, only the Worksheet.
To protect/unprotect a sheet via VBA, use Worksheet-methods protect resp. unprotect (you can apply a password).
To prevent a range to be modified, you have to set it's locked-property to True and protect the sheet (all cells have the propery locked set by default).
Be aware that, if a Range is locked and the worksheet is protected, you cannot modifiy the Range via VBA. If you want to do so, use the unprotect method at the top of the code (but don't forget to protect the sheet again when you're done). As an alternative, you can call protect with parameter UserInterfaceOnly:=True, but unfortunately Excel doesn't save this property. So if you save an Excel file where a worksheet is protected with UserInterfaceOnly:=True and reopen it, the sheet is protected also for VBA.

Workbook protect / unprotect wihtin a macro

I'm developing a macro-enabled spreadsheet that will be used by a select group of semi-intelligent people (managers). I am complete except for one minor hiccup. I want the sheet to be read-only for their use and to require a password to open for editing for my use. Within the macro I have written, once they are complete with their actions the data they have entered is automatically saved on another tab they can not see, then the sheet is reset for further entries/interactions. Once they are done, they should be able to close the sheet without a save prompt as their data has already been saved.
Here is my paradox: I can not get the macro to save over the existing instance of this workbook. If I remove the workbook password within the macro, it saves the workbook without password protection. I have tried to:
unprotect the workbook, save it, then protect it again. Of course, the saved copy is not read/write protected.
SaveAs with the password for writing to it intact, but then I get an error message that the workbook already exists (yes, I have turned off error reporting). Researched a lot of places, can't find a solution.

Resources