Function Create_Addin()
    Dim Filename As String
    On Error GoTo endfunction
    Application.EnableEvents = False
    'mysecurity
    'If uUsername <> oName Then GoTo endfunction
    Application.DisplayAlerts = False
    With ThisWorkbook
        If .IsAddin = True Then GoTo endfunction
        Filename = FileNameNoExt(.Name) & ".xlam"
        lockaddin
        .IsAddin = False
        .SaveAs Filename:=ThisWorkbook.Path & "\" & Filename, FileFormat:=xlOpenXMLAddIn
        .IsAddin = False
        .Save
    End With
    Application.DisplayAlerts = True
    Application.EnableEvents = True
endfunction:
End Function