How to Repair Excel Workbook using VBA?

The following code uses VBA to open and repair the workbook (the option available using Excel Open Dialog)

Sub OpenAndRepairWorkbook()

Dim oWB As Workbook

On Error GoTo Err_Open

Set oWB = Workbooks.Open(Filename:=”C:\ShasurData\ExcelVBA\VBE Tools 2007.xlam”, CorruptLoad:=XlCorruptLoad.xlRepairFile)

Exit Sub


MsgBox Err.Number ; ” – ” ; Err.Description


End Sub

Explore an Upcoming Excel VBA Batch nearby you to, learn effective ways of VB Coding and, automate your routine Excel Reports, processes and tasks with ease.

Happy Excelling
Team Excelgoodies

Leave a Reply

Your email address will not be published. Required fields are marked *