How to close a active document

Hi,

I watched some discussions about closing active documents.

The solutions other people get just don't seem to be working for me. It should be simple I guess....

I tried the code found here: https://forum.solidworks.com/message/24416#24416

Dim swApp As Object

Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

swApp = GetObject("", "SldWorks.Application")

swApp.CloseDoc (swModel.GetPathName)

End Sub

Could someone help me with this. Thanks in advance,

SolidworksParts And Features