How to use On Error GoTo Err1
'Paste first
On Error GoTo Err1:
'Paste in End
Err1:
Resume Next
How to use On Error GoTo Err1
'Paste first
On Error GoTo Err1:
'Paste in End
Err1:
Resume Next
One Line Vba Code:-
1) DISABLE ALERT VBA CODE
Application.DisplayAlerts = False
------------------------------------------------------------------
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
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.
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
------------------------------------------------------------------------------