+ Reply to Thread
Results 1 to 6 of 6

Hide Module for certain users

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Hide Module for certain users

    Hi Experts,

    I have an excel workbook where one of the VBA module reference to a library (Solidworks in this case) that not all users have on their computer.

    These users can still use the workbook as they do not need the macros related to this library, but everytime they open the workbook they get a VBA error and manually have to close the VBA interface before using the workbook.

    Is there any way we can hide the module related to Solidworks to these users ?

    Thanks,

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Hide Module for certain users

    The easiest way would be to convert the code to late bunding. Is would mean that no reference is added at all. You could then put error checking in to capture any issues should they try and rum those macros

  3. #3
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Hide Module for certain users

    for the OPS bunding = binding
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  4. #4
    Registered User
    Join Date
    10-16-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Hide Module for certain users

    I did have a look at Late binding, but it appears that late binding can only be done in subs, am I correct ?

    At the moment my Solidworks module starts this way:

    Please Login or Register  to view this content.
    Which is following by a bunch of subs related to Solidworks.

    For it to work with non-Solidworks users, do I have to put these private variables as Dim inside the subs instead ?

    Thanks,

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Hide Module for certain users

    To use late binding you would declare any SolidWorks objects as Object.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  6. #6
    Registered User
    Join Date
    10-16-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Hide Module for certain users

    Works great !

    Thanks Norie

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. hide vba code from all users
    By vangxbg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2013, 04:13 PM
  2. Hide Column from select users
    By excel2me in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2012, 04:46 PM
  3. Module to Hide Columns
    By montego in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2010, 09:02 PM
  4. how to access Sheet module, normal module, Worbook module to type code
    By alibaba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2009, 07:51 AM
  5. To hide UDF module in Project Explorer Window
    By TRJJK73 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2009, 08:14 AM
  6. How do you hide macros from users?
    By modytrane in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-30-2009, 03:42 PM
  7. [SOLVED] is it possible to Hide certain worksheets from certain users?
    By Admin in forum Excel General
    Replies: 2
    Last Post: 05-04-2005, 05:06 PM
  8. Hide comments from users?
    By 50gumbys in forum Excel General
    Replies: 3
    Last Post: 04-07-2005, 10:08 AM

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