HELP ON API

While i am closing model by using Solidowrks API Code like  swApp.CloseDoc(Model.GetTitle) 

Sometimes code is running sucessfully but some time error is coming by using the above code

********* i am also attach the error file pictures Kindly g o through

Kindly post the reply


SolidworksApi macros