If you use Project Explorer in VB Editor and doubleclick on ThisWorkbook you get the proper code module for this task. Have a look at the dropdowns at the top for the various event trapping possibilities.
Copy/paste this code there :-
Code:
Private Sub Workbook_Open()
Dim Result As String ' not really needed here as it is not used elsewhere
Result = MsgBox("Do not Amend", vbOKOnly, "Warning")
End Sub
No, the code should be into the workbook module.
Please go to VBA (by clicking the menu tool/macros/visual basic editor) in Excel.
Then click on menu : view/project explorer
Then open the project of your workbook and double click on "Thisworkbook"
You are in the workbook module. Paste the code we provided.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.