Got any Excel/VBA Questions? Free Excel Help
Workbook Event Code
Excel is rich in event code for both the Workbook Object and the Sheet Object. For example, the workbook open event is possibly the most popular of Workbook Events (This Workbook).
Delete Workbook Event Code With Code.
You will have to go to Tools>Macro>Security - Trusted Publishers and check Trust access to Visual Basic Editor before running the code
Sub DeleteWorkbookEventCode() ''Needs Reference Set To _ "Microsoft Visual Basic For Applications Extensibility" 'Tools>References. With ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule .DeleteLines 1, .CountOfLines End With End Sub
See also:
Delete Module After Running VBA Code |
Deleting Excel Named Ranges |
Delete Excel Sheet Event Code Macro |
Free Training Course: Lesson 1 - Excel Fundamentals
See also: Index to Excel VBA Code; Index to Excel Freebies; Lesson 1 - Excel Fundamentals; Index to how to… providing a range of solutions
Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.