Since 'ref' is contained in an add-in I thought the section of code causing the problem might be this:

    vData = ThisWorkbook.Worksheets("Ref").Range("ref_table").Value
    Set wks = ActiveSheet
    sName = wks.Parent.Name
Other sections that reference it work.