Hi,

I have a excel document to import text files with a fixed length to check orderfiles for my job.
Now I want the possibility to change some data in the sheet and than export it again to the same format.
I made a macro for the import function with all the fixed length format.

The code I use in my macro for that is:
Sub Orderanalyse()


Worksheets("Order").Range("A3:AH1000").ClearContents

    Dim strFileName As String

    strFileName = Application.GetOpenFilename

        
        

    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;" & strFileName, Destination:=Range("$A$3"))
        .Name = "FILEOPEN...."
        
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = False
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 850
        .TextFileStartRow = 1
        .TextFileParseType = xlFixedWidth
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, _
        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)
        .TextFileFixedColumnWidths = Array(2, 6, 6, 5, 1, 8, 3, 2, 3, 10, 30, 22, 5, 18, 4, 2, 6, 5, _
        6, 13, 7, 5, 6, 2, 25, 6, 3, 8, 2, 1, 3, 3, 1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    
    End With
    
    
End Sub
Is it possible to "reverse" this code and export it for me in the same format?

Thank you!