Repair sketch

Hi, I want to automatically close sketches in SolidWorks VBA that have open contours to create a surface plane feature. Sometimes, in silhouette entities, the repair sketch detects one gap, and I would like to close that gap.