+ Reply to Thread
Results 1 to 7 of 7

MISSING Reference of xlam

Hybrid View

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    MISSING Reference of xlam

    Hi

    In one of my workbook. I have referenced an xlam addin. Now if I change (which is necessary for some reasons) the location of the workbook I face a MISSING myxlam addin in the tools>References. I want my workbook to completely delete the reference while colosing and re-reference it while opening from the path under the variable PluginPath.

    I am successful to reference from the new path with. But I am unable to completely remove from the references windows.

    I am using the below code currently

    Sub AddPlugin()
    Dim RefName as string
    Dim PluginPath as string
    Dim X as interger
    
    RefName=myaddinName
    PluginPath=path to myaddin
    
                         With ActiveWorkbook.VBProject.References
                             For X = .Count To 1 Step -1
                                 If .Item(X).Name Like RefName Then
                                     .Remove .Item(X)
                                 End If
                         Next
                         End With
        End If
    End Sub
    But not working .After changing the location it leaves a MISSING infront of the name of addin

    What am I missing

    Help would be greatly appreciated

    Best Regards
    Imran Bhatti
    Teach me Excel VBA

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: MISSING Reference of xlam

    Is the 'MISSING' reference still checked?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: MISSING Reference of xlam

    Yes the MISSING REFERENCE IS STILL CHECKED.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: MISSING Reference of xlam

    What's the full code? I assume you have some code to correct the path and also an error handler as you didn't mention any errors while running the code above?

    Do you really need the reference to the .xlam? If so, why do you need to move it?

  5. #5
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: MISSING Reference of xlam

    If IsPluginOpen = True And Not ActiveWorkbook.Name Like "*Template*" Then
       If InStr(1, VBA.LCase(ActiveWorkbook.Keywords), "completed") Or InStr(1, VBA.LCase(ActiveWorkbook.Keywords), "imported") Or _
                   InStr(1, VBA.LCase(ActiveWorkbook.Keywords), "cancelled") Then
            If ErrN = 0 Then
            MBAEssentials.PluginInstance = MBAEssentials.PluginInstance - 1
                With ActiveWorkbook.VBProject.References
                      For X = .Count To 1 Step -1
                          If .Item(X).Name Like RefName Then
                              .Remove .Item(X)
                              'Excel.Workbooks("TaskPlugin.xlam").Close False
                          End If
                  Next
                  End With
        End If
    End If
    End If
    1) Yes I set the path at runtime towords the addin. using thisworkbook.path and then concatenating the rest of the path.
    I have to move the workbook and not the addin. As the workbook changes its position

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: MISSING Reference of xlam

    Oh, I misunderstood- I thought you were moving the add-in. Why does moving the workbook cause an issue with the add-in? Are you moving it to another computer that does not have access to the add-in location? And, again, why do you need to set a reference to the add-in's project?

  7. #7
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: MISSING Reference of xlam

    There is a shared folder in the dropbox named TaskPlugin wherein the AddIn resides (and of course the users are not on the same network. The name of the AddIn as a file is "TaskPlugin" but in the references list it appears as "CashBookLink"
    Every colleague across Pakistan is using the same AddIn.When they complete their work and save their workbook that should remove the Addin Reference So that when opening that workbook at Head Office should load the same plugin but from the path of the Head Office PC. But when the workbook is opened at head office the compile error occurs higlighting the Environ$("username") line. I tried using VBA.Environ and Environ("username")& etc but the reason is the plugging is "with a capital MISSING still there (ticked ) in the references and I have to first spend 5 to 7 minutes to uncheck that reference and then manually referencing the same addin from my pc.



    EDIT: Also tried http://www.vbaexpress.com/kb/getarticle.php?kb_id=272. But no luck.
    Last edited by ImranBhatti; 12-19-2017 at 01:49 AM.

+ 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. Missing reference
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2016, 06:27 AM
  2. Find missing reference(s)
    By Sgligori in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-06-2016, 08:20 AM
  3. Missing reference in reference library???
    By JapanDave in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2013, 05:00 AM
  4. Remove missing reference, update outlook reference
    By Snoopy2003 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-29-2011, 08:35 PM
  5. Addin (xlam) questions: (1) Reference being 'lost' and (2) Potential security concern
    By lesotho72 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2010, 03:56 AM
  6. [SOLVED] Missing Reference?
    By The parawon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2005, 10:06 AM
  7. [SOLVED] A missing reference, maybe?
    By The parawon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-15-2005, 09:06 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