I'm Dilip Ramadas. By profession, I’m a Business Analyst. In my career, I’ve worked as an employee, freelance, and also consultant in my spare time. My job greatly revolves around researching new tech in a given industry, research for locations for a new startup, marketing/product placement strategies, analytics, and automation. While doing so I have always tried my best to learn as is possible. My interest areas are analytics, MS Excel, VBA, WordPress, Learning, Organic farming, etc.

Code – Delete active workbook

Sub DeleteActiveWorkbook() If Application.ProtectedViewWindows.Count > 0 Then Application.ActiveProtectedViewWindow.Edit End IfDim xFullName As String xFullName = Application.ActiveWorkbook.FullName ActiveWorkbook.Saved = True Application.ActiveWorkbook.ChangeFileAccess xlReadOnly Kill xFullName Application.ActiveWorkbook.Close False End Sub