+ Reply to Thread
Results 1 to 4 of 4

Protect my modules

  1. #1
    Registered User
    Join Date
    08-09-2005
    Posts
    42

    Protect my modules

    Hello,

    Can anyone help how to protect macros in excel???

    I know that I can protect my VBA Project with password, but this protection is very easy to break.

    I think that maybe the better way would be using my modules with macros as excel "add in", but in this case I dont know how to assign a macros from excel "add in" to object (buttons...).

    Any ideas or experiences???

    Thanks

    tommy

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Tommy,

    Using the Add-in is good idea since the Add-in can be locked for viewing. If you plan to distribute your workbook that calls the Add-in macros then the Add-in will always have to accompany your main workbook. This applies to emails if the recipient needs to run the workbook.

    Add-in macros don't show up in the Macro List dialog (in Excel press ALT+F8 to display it). This isn't a problem because you created the Add-in and know what macros are available. To use them you must qualify the macro name with the Add-in workbook name.
    Please Login or Register  to view this content.
    When writting macros for your Add-in remember the ThisWorkbook refers to the Add-in workbook. To refer to the user's workbook use ActiveWorkbook. If any of your sheets are protected, display a dialog asking the user to remove the sheet protection. Don't do this from the Add-in. Lastly, you will have to add error handling to the Add-in code. If the user workbook doesn't match with what you expect to be there then you need to alert the user or trap the potential error.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    08-09-2005
    Posts
    42

    Trying to call macro

    Dear Leith Ross,

    thank for your help.

    I am trying to use your code, but somehow excel has a problem with syntax, cause gives me a message "expected identifier".

    I also find an article, where is described that I can just simply through Alt+F8 can assign macro from add in to object, but it also doesn't work :-)

    http://www.fontstuff.com/vba/vbatut03.htm

    Any idea what I am doing wrong?

    tommy

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Tommy,

    Did you remember to first load the Add-in before making the call from the other workbook?. In response to the second question, in my previous post I said:
    Add-in macros don't show up in the Macro List dialog (in Excel press ALT+F8 to display it).
    You can still assign a hot key to the macro this way, but you have to know the name first. You can type in the template macro name, provided it is loaded, and Excel will find it.

    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1