Draftsight - how do you close a document with VBA?

Hello everyone,

I have to export all the layers contained in every drawings of a directory. I managed to open a document in Draftsight through VBA Excel, extract all the layers and save them as pdf but my main problem is that I can't find a way to close the document i'm currently exporting the layers in order to open another...etc the only way I found is to deal with all the drawings (i.e open them all in draftsight and export the layers) and then kill the application when I'm done. But you know...when you have more than 80 drawings, well...your application starts to suffer once reaching 40.

Anyhelp on how to use the sub CloseDocument ? 

When i type F2, VBA tells me to use this sub like this: 

"Sub CloseDocument(PathName As String, SaveChanges As Boolean)"

But it doesn't work...either an error tells me that " = is missing" and once i try something with = then it tells me it needs a function or a variable.

 

Help please!!

 

 

N.B: i use Draftsight 1.0 Type Library (dsAutomation.dll) for what it worths