standalone app to convert part to iges

Hi all,

Initially I had developed a standalone C# app to convert Solidworks part files to STEP. Now I would also like to convert them to IGES. As I had read from the documentation of the SaveAs method, we just need to change the extension of the target file and it would convert it accordingly. But after changing it to '.IGS', the conversion doesn't happen.

Its the same code that converts the file to step with the extension of the target file changed. But it throws an swGenericSaveError error.

Please let me know what other changes do I need to make here.

EDIT: Attached the code

SolidworksApi macros