+ Reply to Thread
Results 1 to 4 of 4

Reference settings attached to workbook or application or something else?

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    San Francisco, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Reference settings attached to workbook or application or something else?

    Hi,

    In the VBA editor, Tools > References...

    Are the checked available references attached to the workbook, to the instance of Excel, to the machine’s Excel settings, or do they depend on something else (such as the VBA code contained in the workbook's VBProject)?

    If I perform the following experiment...
    A) Open a workbook, enable/disable certain references, save and close the file, and close Excel.
    B) Then open Excel again, open a different workbook, enable/disable a different set of references, save and close.
    C) Then open the original workbook. Would I see the reference settings from A) or B)?

    ...I get different results for numerous different scenarios ran (for some experiments the references seemed to be attached to the machine's Excel settings, for others to the files...).

    My end goal is to programmatically set a reference to be checked or not - depending on some argument. The easiest way, from my reading today, would be to ensure that in the base version the reference is always checked... and then programmatically uncheck it if the argument tells us to. (Versus programmatically adding a reference).

    So I'd like a hard-and-fast rule that allows me to anticipate, without uncertainty, whether a particular reference will be checked for a certain file on a certain machine.

    Thanks all,

    Jim

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Reference settings attached to workbook or application or something else?


    Hi !

    Instead of using an early binding (via activating any reference to the project)
    why not using a late binding via the CreateObject statement ?

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: Reference settings attached to workbook or application or something else?

    References are saved with the workbook.

  4. #4
    Registered User
    Join Date
    07-26-2012
    Location
    Slovakia
    MS-Off Ver
    2013
    Posts
    25

    Re: Reference settings attached to workbook or application or something else?

    I would suggest you to loop through references, and if the one is not checked, then add it via VBA. The reason is, when you will distribute the excel between different users the references can vary. But you have to also be aware in case users have different version of excel, so the libraries are different as well.

+ 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. [SOLVED] Dynamic Range w/ Chart Issue - Reference Problem (attached file)
    By Wrathard in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-20-2018, 10:44 AM
  2. [SOLVED] Circular Reference Error. One for the pro's :-) Sheet attached.
    By unclejemima in forum Excel General
    Replies: 12
    Last Post: 11-29-2017, 02:03 AM
  3. Side effects of changing application settings
    By MarmaladeLover in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2015, 12:42 PM
  4. Replies: 8
    Last Post: 10-28-2013, 07:36 PM
  5. [SOLVED] cross reference - Please see attached file
    By itselflearn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-03-2013, 04:23 PM
  6. How to change default settings in an application menu
    By anmck in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2010, 11:28 AM
  7. Change Application Security Settings
    By WhytheQ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2006, 05:10 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