Decline macro to be viewed? How?

If it’s possible how would I have macros still work but decline allowing the macros and their code to be viewed, copied, or saved locally by the user? I only want to allow users to use the document. I don’t want them being able to edit it, mess it up (because they don’t know what they’re doing or they want to steal it and release it as their own), and then have to fix it or the authors don’t get the credit they deserve for their hard work.

I’d prefer them being locked so when they’re locked nobody can do anything with them including view the code to re-write it.

It will be on a NAS (Network-Attached Storage) where anyone with the link, from anywhere, can use it. Apparently even though the sheets are protected the macro’s can still be viewed and even edited.

Assign a password to the macro library (note that “Standard” library can’t be password-protected).

You answered in the comments section. I would not know there was any content added to this if I didn’t check. You’re aware there’s a separate text field for an answer?

Anyway. I found and followed this

Added a new library, copied the code over, passworded it, and I can still view and edit it.
Did I do something wrong? The password icon is there.

Saving it, closing the document, and re-opening caused the password to take effect. But now the macro’s are erroring. Perhaps I didn’t copy all of them although I used ctrl+a or naming them differently did that.

But now the macro’s are erroring.

What error? Which is LO version? There were some bugfixing for password-protected libraries - e.g., tdf#57113 fixed in LO 7.0, or tdf#135799 fixed in 7.0.2.

v7.1.4.2
I looked in to updating the version and the option in calc to check for updates says it’s up to date after checking.

When I try to run a copied macro that works perfectly in the original document from the tools menu:

A Scripting Framework error occurred while running the Basic script MidiWriter.MidiEditor.onDblClickCell.
Message: wrong number of parameters!

When I try to run any of the copied macros from Tools > Macro’s > Organize it either gives a run time or syntax error saying what’s being called is “already defined”. Rem’ing the run time and syntax errors out didn’t work. I have to rem almost the entire script for it to stop erroring.

WinMerge says the code is 100% identical between the sheet that works and the sheet that errors. In the sheet that works they’re also copied from a different sheet the person that wrote the scripts for me created. The library’s have to be named “Standard”? There’s zero instances of the word “Standard” in the code. None.

The library’s have to be named “Standard”?

Who told you that? The “Standard” is only special that it can’t be password-protected.

Anyway, possibly there’s another bug in password-protected libraries; if it’s not reported, we can’t fix something we don’t know about and can’t reproduce :wink:

I also tried exporting and importing the macros from the sheet that works to a brand new sheet that has the same exact info in the same exact cells. Same exact everything everywhere including the macro code. Still errors.

The only thing that’s different is the name of the macro library the macros are in. I have several backups I made of the progress on this project. They all work except for this one I’m trying to protect the macros in before I share it.

If the macro name has to be “Standard” so they work how am I going to protect the macros? I searched every macro’s coding for the word Standard with notepad++. There’s not even one place in any of the code for any of the macros that states that library name.

I understand the process of debugging and investigating bugs. It can be reproduced. Copy an advanced macro into a new sheet from the Standard library with a different library name.
If I leave the library name Standard it works. It stops working and starts throwing error after error when I change the name of the library so I’m able to protect it.
I will report it, maybe I did find a bug. Thanks!

Question was answered in a comment. This text field is too far down for people to scroll down to and click in to to type an answer? It’s not for me. I can see the giant text “Be the first one to answer this question!” with the bright blue text “Add Answer” under it. I’m placing this here so I’m aware there’s been an answer. This might possibly be a bug. I’ve submitted a report.

If someone else has some input on the issue please post in the ANSWER field, not as a comment, so it’s listed on my questions profile page and I know it’s here. Thanks!

This field works. I don’t get why people don’t use it.
?? Lots of really talented and intelligent people here…Why don’t they use the correct fields and features?

I use what is correct to use when I’m not sure it’s a working solution. And as seen in the bug you filed (tdf#143306), the thing needs more massaging before being correctly answered, which is what I possibly will do when everything is clear. Trying to enforce your vision of the workflow here upon those who are seasoned contributors to this site is not appropriate.