The issue arises near the end at appXL.Run "MTD".
Public Function mtd_only() On Error GoTo Err_mtd_only Dim dbs As DAO.Database Dim rst As DAO.Recordse