Error while check in multi-sheet drawing in PDM

Hi all,

I am working on a stand alone program. Program opens drawings in a given folder, adds 4 more sheets (actually translates first sheet to four diff languages), saves the drawing, saves the drawing in PDF and DWG, closes the drawing and, while checking in the drawing, program throws the exception while:

1. setting the variables for all sheets (iEdmEnumeratorVariable8::SetVar)

2. getting configurations from file (iEdmFile7::GetConfigurations)

3. unlocking file (iEdmFile7::UnlockFile)

The exception is : An invalid pointer was supplied to the method

I have set 'Embed Interop Types' to False

Any help is appreciated.

Thanks a lot in advance...

SolidworksApi/macros