Reputation: 283
we have a COM add-in that we use in MS Office application like Word and Excel. That COM add-in has exposed few APIs to use, which we use for customization.
Problem is - Any user can access the APIs and that is causing security problems. we dont want that to happen, we want to give access to VBA editor to only few peoples.
Is there any way - to disable VBA editor, without disabling VBA, because we want to use other Macros and Add-ins.
Thanks in advance!
PS - I tried hiding 'Developer' tab from toolbar but anyone who knows shortcut (ALT-F11), can still use it.
Upvotes: 1
Views: 7188
Reputation: 22905
The VBA Password Protection does not actually protect you from people reading the file. It's incredibly simple to remove the protection.
One alternative is to obfuscate the COM API as well as the VBA (so that, even if people can read the code, it would be difficult to figure out what's going on). Apple has done this in the past (e.g. isYoMamaWearsCombatBootsSupported -- https://github.com/JaviSoto/iOS7-Runtime-Headers/commit/6ccf9c4526992fec0dc414d48e4a3f7446e9822f#L10R61)
Upvotes: 1
Reputation: 6770
If one of the requirements of the COM Add-In is restricted access, the solution shouldn't be to disable anything than can access it. The answer should be to fix the add-in itself. An easy way to do it would be to define a user group that can use the add-in, and then just make the add-in check to verify the user is a member of that group. That should be simple to implement and simple to maintain.
Upvotes: 2
Reputation: 53850
Can't you add a password to view/edit code? then at least they can't see your api and should prevent them from opening the editor.
Right click the project in the VBA project window and select 'properties' to add a password to that project in the Protection tab.
Upvotes: 0