about CATIA V5 VBA macros

I'd like to know about CATIA V5 VBA macros. I created the macro syntax below to save a part model as a STEP file and an IGES file, but an error occurs and the macro won't run. I'd like to know the correct syntax.

(syntax)

### VBAマクロの例

```vba

Sub ExportToSTEPandIGES()

    Dim CATIA As Application

    Dim documents As Documents

    Dim partDoc As PartDocument

    Dim exportStepPath As String

    ' CATIAアプリケーションの取得

    Set CATIA = Application

    Set documents = CATIA.Documents

    ' アクティブな部品文書を取得

    Set partDoc = documents.ActiveDocument

    ' エクスポートするファイルパスを指定

    exportStepPath = "C:\\YourPath\\YourPart.stp"

    exportIgesPath = "C:\\YourPath\\YourPart.igs"

    ' STEP形式でエクスポート

    partDoc.ExportData exportStepPath, "STP"

    ' IGES形式でエクスポート

    partDoc.ExportData exportIgesPath, "IGS"

    ' 後処理

    Set partDoc = Nothing

    Set CATIA = Nothing

    ' メッセージボックスで完了通知

    MsgBox "エクスポートが完了しました。", vbInformation

End Sub