Share via

export from excel to .pnr format

Anonymous
2021-06-10T13:15:29+00:00

Hi guy. I have to export a worksheet from excel (xlsx) to a file with .prn extension.

My problem is: numeric field with two decimal where the last number is 0 the 0 has been troncated. Also the export in .txt format has the same problem. How can I do to export the file correctly? Thank you.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2021-06-10T13:53:19+00:00

    Hi

    My name is André. I am an independent consultant.

    >I had a similar problem in the past, actually it wasn't really a problem, because when I open the file in Excel itself, it handles the numbers differently, having to reapply two-decimals-places formatting, but when I opened it in one text editor it is correct, as in the example print.

    Take a test if you open the pnr file you saved.

    And open it in some text editor like notepad. See if it keeps 0 or not.

    Answer here so I can continue helping you.

    André.

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2021-06-10T15:47:04+00:00

    Perfect, it really is a great solution. I'm going to close the topic so your solution can help others with the same problem.

    Thank you so much

    André

    0 comments No comments
  3. Anonymous
    2021-06-10T14:16:38+00:00

    Thank you. The only way I find is to set in excel the column with a define lenght (I have made a macro) and also a column of lenght 1 with a bar to separe all fields. So it seem to work correctly............ in this way the file .prn has the correct lenght for un upload on another prg.............

    MACRO FOR SETTING THE LENGHT

    Sub formattacolonnedirex()

    '

    ' formattacolonnedirex Macro

    Cells.Select 
    
    Selection.ColumnWidth = 74.29 
    
    Cells.EntireRow.AutoFit 
    
    Cells.EntireColumn.AutoFit 
    
    Rows("1:1").Select 
    
    Selection.Delete Shift:=xlUp 
    
    Columns("A:A").Select 
    
    Selection.ColumnWidth = 10 
    
    Columns("C:C").Select 
    
    Selection.ColumnWidth = 10 
    
    Columns("E:E").Select 
    
    Selection.ColumnWidth = 5 
    
    Columns("G:G").Select 
    
    Selection.ColumnWidth = 5 
    
    Columns("I:I").Select 
    
    Selection.ColumnWidth = 40 
    
    Range("B:B,D:D,F:F,H:H").Select 
    
    Range("H1").Activate 
    
    Selection.ColumnWidth = 1 
    

    End Sub

    0 comments No comments