+ Reply to Thread
Results 1 to 6 of 6

Setting References in VBA so Users don't have to

  1. #1
    Forum Contributor
    Join Date
    04-13-2010
    Location
    England
    MS-Off Ver
    Office 2016 365
    Posts
    211

    Setting References in VBA so Users don't have to

    I am not a developer but i've managed to put together a workbook for my team to use that has quite a bit of code in - it works for me but when i distributed it some users got a Compile Error as soon as they tried to open it.

    I think the reason is they don't have their references set-up but these are low level excel users, i don't want them to have to do this themselves.

    I was hoping i could use the workbook open event to ensure the references required are set-up. Can anyone help me with the best approach for this?
    My references are; Visual Basic For Applications, MS Excel 14.0 Object Library, OLE Automation, MS Office 14.0 Object Library, MS Forms 2.0 Object Library, MS Windows Common Controls-2 6.0 (SP6)

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

    Re: Setting References in VBA so Users don't have to

    They are set up automatically. The problem you have is that the software they reference (or the version) is not installed on their machine. Looking at your list, MS Common Controls will get you into trouble as it's probably not installed on users' machines - they'll need to download and install it. Are you actually using the controls in it?

  3. #3
    Forum Contributor
    Join Date
    04-13-2010
    Location
    England
    MS-Off Ver
    Office 2016 365
    Posts
    211

    Re: Setting References in VBA so Users don't have to

    thanks for the quick response Kyle - i've had a look at one of the users who is having the issue and yes, MS Windows Common Controls is missing from his list of available references...but oddly - another user who is not experiencing the issue, also doesn't have MS Windows Common Controls available to them....

    I'm not sure if i am using any of those controls - i have unticked it from my list and opened up the workbook and used some of the controls without an issue - i've checked the user's application security settings and they also seem the same as mine. I am definitely missing something here.....

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

    Re: Setting References in VBA so Users don't have to

    If you've set a reference to something that's not installed on a machine, even if you aren't using it you'll get errors. Remove the tick in the common controls, re-distribute and see if everything works - do these users experiencing issues have any other missing references?

  5. #5
    Forum Contributor
    Join Date
    04-13-2010
    Location
    England
    MS-Off Ver
    Office 2016 365
    Posts
    211

    Re: Setting References in VBA so Users don't have to

    Thanks, i'm going to try and get the user to open it again as i've just redistributed the link - will see how we get on and update shortly thanks for your time and help!

  6. #6
    Forum Contributor
    Join Date
    04-13-2010
    Location
    England
    MS-Off Ver
    Office 2016 365
    Posts
    211

    Re: Setting References in VBA so Users don't have to

    So, i've sent the user in question a single workbook with only 3 reference libraries enabled Visual Basic For Applications, MS Excel 14.0 Object Library, MR Forms 2.0 - i put a single activex button with one line of code on the click event
    Please Login or Register  to view this content.
    the user still gets the error: "Compile Error: Object Library Invalid or contains references to object definitions that could not be found"

    so it isn't my workbook, this guy can't run code full stop - even with minimal security settings in Excel

    So it must be his install or environment or user profile - googling the error and people suggest removing registry keys which is beyond my comfort zone really always fearful of mucking with the registry!

    So, i think im gonna to suggest a re install of excel and see from there.....

+ 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. Replies: 2
    Last Post: 10-13-2021, 01:03 AM
  2. Replies: 0
    Last Post: 06-25-2015, 07:15 AM
  3. Replies: 6
    Last Post: 08-08-2014, 09:46 PM
  4. Allow Users to Edit Ranges Using Users from a Network Location
    By Tayque_J_Holmes in forum Excel General
    Replies: 0
    Last Post: 10-24-2013, 06:34 AM
  5. Setting references code problem
    By Wylie C in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2005, 06:20 PM
  6. Setting references code problem
    By Wylie C in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2005, 06:17 PM
  7. Help - Automating a file.. Adding Users , Deleting users, Changing
    By Tim Harding in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-16-2005, 10:06 AM

Tags for this Thread

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