I have some troubles in translating my VBA code in excel to macscript. Now I have an error (error 429: activeX component can't create object) on CreateObject, and I don't know how to solve it. I hope you guys can help me. This is the code:
 Function FactuurOpslaan()
    Dim stPath As String
    With Sheets("Factuur Opstellen")
        stPath = ActiveWorkbook.Path & "\Facturen\"
        stPath = stPath & "Facturen" & Space(1) & MaandNaam(Month(Now)) & "-" & Year(Now)
        With CreateObject("Scripting.FileSystemObject")
             If Not .FolderExists(stPath) Then .CreateFolder stPath
        End With
.ExportAsFixedFormat 0, stPath & "\Factuur " & .Range("F29") & ".pdf", , 1
    End With
End Function