SaveAs method does not work with flatten dxf in Win7 x64?

SaveAs method returns error code 256 "not known file format" when I try to save flatten dxf of sheet metal part in SW2010 SP5.0 WIN7 x64.

The method works fine in XP 32-bit. If I record a macro and try to run it, macro returns the same error.

SolidworksApi macros