How to use On Error GoTo Err1

How to use On Error GoTo Err1



'Paste first

On Error GoTo Err1:

'Paste in End

Err1:

Resume Next


One Line Vba Code:-

 One Line Vba Code:-


1) DISABLE ALERT VBA CODE

Application.DisplayAlerts = False

------------------------------------------------------------------


How to use Confirm prompt box in Excel

How to use Confirm prompt box in Excel

Note:- Green hightlight you can change


Dim response As VbMsgBoxResult

    response = MsgBox("Do you want to Import image for ppt ", vbYesNo + vbQuestion, "Confirmation")

    If response = vbYes Then

Else

        MsgBox "Pls Paste image manual for ppt"

       End If

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




How to Disable excel Vba add ins.

How to Disable excel Vba add ins.

Blue highlight copy for using code

--------------------------------------------------------------------------

Private Sub Workbook_Open()

 Dim addIn As addIn

    ' Loop through each add-in and disable it

    For Each addIn In Application.AddIns

        addIn.Installed = False

    Next addIn

End Sub

------------------------------------------------------------------------------





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

Recent Posts

Breaking

Recent Posts

Trending Topic

Breaking

Related Post No.

Pages