How to Upgrade / Install add ins before file save with confirmation dialog box

 Below copy code for using:-

Note:- below highlight file name add ins (change file name)


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

  ' Display a Yes/No confirmation dialog

    Dim response As VbMsgBoxResult

    response = MsgBox("Do you want to Install/Upgrade add ons? if yes pls select overwrite change in prompt ", vbYesNo + vbQuestion, "Confirmation")

Application.DisplayAlerts = False

    ' Check the user's response

    If response = vbYes Then

       xlamFilePath = Application.UserLibraryPath & "Retail_Add_ons.xlam"

ActiveWorkbook.SaveAs xlamFilePath, FileFormat:=xlOpenXMLAddIn

Else

        MsgBox "Not install only save file "

        ' Add your code to execute when the user clicks No or closes the dialog

    End If

    End Sub




Related Posts:

About Me

author Click here for Connect FB

Click here for Linkedin

Related Post No.

Powered by Blogger.

Contact Form

Name

Email *

Message *

Search This Blog

Breaking

Popular Posts

Trending Topic

Breaking

Related Post No.

Pages