Programmatically Install Add-In VBA












4















I'm looking to create a macro that'll install an add-in for the user to the excel ribbon. I'm upto:



Private Sub Workbook_Open()

On Error Resume Next
Application.AddIns("Name of Addin").Installed = False
On Error GoTo 0

With Application
.AddIns.Add "Filepath to addin in shared location", False
.AddIns("Name of Addin").Installed = True
End With

ThisWorkbook.Close False

End Sub


Once running the macro, the addin installs to the ribbon no problems. The issue is, once excel is closed down, the addin no longer shows in the ribbon.



It would appear that excel is expecting the addin to be copied into the users C:Documents and SettingsUsernameApplication DataMicrosoftAddiIns folder as it throws the error that it can't find it when starting excel after closing down.



Now my understanding is that the second (false) variable for the line of code below basically says that the addin shouldn't be copied to the AddIns directory and rather should stay in the shared location.



.AddIns.Add "Filepath to addin in shared location", False


Any ideas on why Excel is expecting the addin to be in the users default folder?










share|improve this question

























  • It is not necessary that you have to copy the Add-In to the specific Add-In folder but yes, it needs to reside on your hard drive. I guess Shared Drive is considered as "Removalble Drive" as it can be disconnected anytime. Form Excel's Help file Ignored if the add-in file is on a hard disk. True to copy the add-in to your hard disk, if the add-in is on a removable medium (a floppy disk or compact disc). False to have the add-in remain on the removable medium. If this argument is omitted, Microsoft Excel displays a dialog box and asks you to choose.

    – Siddharth Rout
    Jan 25 '14 at 16:34











  • @SiddharthRout Thanks for your comment, I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed. I'm thinking one solution could be to build another addin that can reside on the local machines hard drive and then load the shared addin when excel starts. The addin needs to remain in a shared location for maintenance purposes. Cheers

    – Gareth
    Jan 25 '14 at 17:40








  • 3





    ` I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed.` In that case, check if there is any code which is unloading the add-in when the workbook closes. check in both (above workbook and in the add-n)

    – Siddharth Rout
    Jan 25 '14 at 20:39
















4















I'm looking to create a macro that'll install an add-in for the user to the excel ribbon. I'm upto:



Private Sub Workbook_Open()

On Error Resume Next
Application.AddIns("Name of Addin").Installed = False
On Error GoTo 0

With Application
.AddIns.Add "Filepath to addin in shared location", False
.AddIns("Name of Addin").Installed = True
End With

ThisWorkbook.Close False

End Sub


Once running the macro, the addin installs to the ribbon no problems. The issue is, once excel is closed down, the addin no longer shows in the ribbon.



It would appear that excel is expecting the addin to be copied into the users C:Documents and SettingsUsernameApplication DataMicrosoftAddiIns folder as it throws the error that it can't find it when starting excel after closing down.



Now my understanding is that the second (false) variable for the line of code below basically says that the addin shouldn't be copied to the AddIns directory and rather should stay in the shared location.



.AddIns.Add "Filepath to addin in shared location", False


Any ideas on why Excel is expecting the addin to be in the users default folder?










share|improve this question

























  • It is not necessary that you have to copy the Add-In to the specific Add-In folder but yes, it needs to reside on your hard drive. I guess Shared Drive is considered as "Removalble Drive" as it can be disconnected anytime. Form Excel's Help file Ignored if the add-in file is on a hard disk. True to copy the add-in to your hard disk, if the add-in is on a removable medium (a floppy disk or compact disc). False to have the add-in remain on the removable medium. If this argument is omitted, Microsoft Excel displays a dialog box and asks you to choose.

    – Siddharth Rout
    Jan 25 '14 at 16:34











  • @SiddharthRout Thanks for your comment, I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed. I'm thinking one solution could be to build another addin that can reside on the local machines hard drive and then load the shared addin when excel starts. The addin needs to remain in a shared location for maintenance purposes. Cheers

    – Gareth
    Jan 25 '14 at 17:40








  • 3





    ` I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed.` In that case, check if there is any code which is unloading the add-in when the workbook closes. check in both (above workbook and in the add-n)

    – Siddharth Rout
    Jan 25 '14 at 20:39














4












4








4








I'm looking to create a macro that'll install an add-in for the user to the excel ribbon. I'm upto:



Private Sub Workbook_Open()

On Error Resume Next
Application.AddIns("Name of Addin").Installed = False
On Error GoTo 0

With Application
.AddIns.Add "Filepath to addin in shared location", False
.AddIns("Name of Addin").Installed = True
End With

ThisWorkbook.Close False

End Sub


Once running the macro, the addin installs to the ribbon no problems. The issue is, once excel is closed down, the addin no longer shows in the ribbon.



It would appear that excel is expecting the addin to be copied into the users C:Documents and SettingsUsernameApplication DataMicrosoftAddiIns folder as it throws the error that it can't find it when starting excel after closing down.



Now my understanding is that the second (false) variable for the line of code below basically says that the addin shouldn't be copied to the AddIns directory and rather should stay in the shared location.



.AddIns.Add "Filepath to addin in shared location", False


Any ideas on why Excel is expecting the addin to be in the users default folder?










share|improve this question
















I'm looking to create a macro that'll install an add-in for the user to the excel ribbon. I'm upto:



Private Sub Workbook_Open()

On Error Resume Next
Application.AddIns("Name of Addin").Installed = False
On Error GoTo 0

With Application
.AddIns.Add "Filepath to addin in shared location", False
.AddIns("Name of Addin").Installed = True
End With

ThisWorkbook.Close False

End Sub


Once running the macro, the addin installs to the ribbon no problems. The issue is, once excel is closed down, the addin no longer shows in the ribbon.



It would appear that excel is expecting the addin to be copied into the users C:Documents and SettingsUsernameApplication DataMicrosoftAddiIns folder as it throws the error that it can't find it when starting excel after closing down.



Now my understanding is that the second (false) variable for the line of code below basically says that the addin shouldn't be copied to the AddIns directory and rather should stay in the shared location.



.AddIns.Add "Filepath to addin in shared location", False


Any ideas on why Excel is expecting the addin to be in the users default folder?







excel vba excel-vba install






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 29 '18 at 2:32









Cœur

17.6k9105145




17.6k9105145










asked Jan 25 '14 at 12:07









GarethGareth

3,41042755




3,41042755













  • It is not necessary that you have to copy the Add-In to the specific Add-In folder but yes, it needs to reside on your hard drive. I guess Shared Drive is considered as "Removalble Drive" as it can be disconnected anytime. Form Excel's Help file Ignored if the add-in file is on a hard disk. True to copy the add-in to your hard disk, if the add-in is on a removable medium (a floppy disk or compact disc). False to have the add-in remain on the removable medium. If this argument is omitted, Microsoft Excel displays a dialog box and asks you to choose.

    – Siddharth Rout
    Jan 25 '14 at 16:34











  • @SiddharthRout Thanks for your comment, I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed. I'm thinking one solution could be to build another addin that can reside on the local machines hard drive and then load the shared addin when excel starts. The addin needs to remain in a shared location for maintenance purposes. Cheers

    – Gareth
    Jan 25 '14 at 17:40








  • 3





    ` I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed.` In that case, check if there is any code which is unloading the add-in when the workbook closes. check in both (above workbook and in the add-n)

    – Siddharth Rout
    Jan 25 '14 at 20:39



















  • It is not necessary that you have to copy the Add-In to the specific Add-In folder but yes, it needs to reside on your hard drive. I guess Shared Drive is considered as "Removalble Drive" as it can be disconnected anytime. Form Excel's Help file Ignored if the add-in file is on a hard disk. True to copy the add-in to your hard disk, if the add-in is on a removable medium (a floppy disk or compact disc). False to have the add-in remain on the removable medium. If this argument is omitted, Microsoft Excel displays a dialog box and asks you to choose.

    – Siddharth Rout
    Jan 25 '14 at 16:34











  • @SiddharthRout Thanks for your comment, I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed. I'm thinking one solution could be to build another addin that can reside on the local machines hard drive and then load the shared addin when excel starts. The addin needs to remain in a shared location for maintenance purposes. Cheers

    – Gareth
    Jan 25 '14 at 17:40








  • 3





    ` I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed.` In that case, check if there is any code which is unloading the add-in when the workbook closes. check in both (above workbook and in the add-n)

    – Siddharth Rout
    Jan 25 '14 at 20:39

















It is not necessary that you have to copy the Add-In to the specific Add-In folder but yes, it needs to reside on your hard drive. I guess Shared Drive is considered as "Removalble Drive" as it can be disconnected anytime. Form Excel's Help file Ignored if the add-in file is on a hard disk. True to copy the add-in to your hard disk, if the add-in is on a removable medium (a floppy disk or compact disc). False to have the add-in remain on the removable medium. If this argument is omitted, Microsoft Excel displays a dialog box and asks you to choose.

– Siddharth Rout
Jan 25 '14 at 16:34





It is not necessary that you have to copy the Add-In to the specific Add-In folder but yes, it needs to reside on your hard drive. I guess Shared Drive is considered as "Removalble Drive" as it can be disconnected anytime. Form Excel's Help file Ignored if the add-in file is on a hard disk. True to copy the add-in to your hard disk, if the add-in is on a removable medium (a floppy disk or compact disc). False to have the add-in remain on the removable medium. If this argument is omitted, Microsoft Excel displays a dialog box and asks you to choose.

– Siddharth Rout
Jan 25 '14 at 16:34













@SiddharthRout Thanks for your comment, I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed. I'm thinking one solution could be to build another addin that can reside on the local machines hard drive and then load the shared addin when excel starts. The addin needs to remain in a shared location for maintenance purposes. Cheers

– Gareth
Jan 25 '14 at 17:40







@SiddharthRout Thanks for your comment, I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed. I'm thinking one solution could be to build another addin that can reside on the local machines hard drive and then load the shared addin when excel starts. The addin needs to remain in a shared location for maintenance purposes. Cheers

– Gareth
Jan 25 '14 at 17:40






3




3





` I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed.` In that case, check if there is any code which is unloading the add-in when the workbook closes. check in both (above workbook and in the add-n)

– Siddharth Rout
Jan 25 '14 at 20:39





` I've got a previous xla addin that I keep stored on the shared drive which stays loaded after excel is closed.` In that case, check if there is any code which is unloading the add-in when the workbook closes. check in both (above workbook and in the add-n)

– Siddharth Rout
Jan 25 '14 at 20:39












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21350305%2fprogrammatically-install-add-in-vba%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21350305%2fprogrammatically-install-add-in-vba%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas