'.trd files contain data in 'short real' binary format 'They are obtained when writing data using a RTES task 'with the EOPEN directive. 'This file format is compatible with the WinRTES TREND facility. 'Import a .trd file into Excel spreadsheet. 'This macro is written for files that use 30 variables (time+28 data+date) 'Edit 'item(30)' and the "For i=" statements for other record sizes Option Explicit Sub Read_Binary_File() Dim NewRange As String Dim i As Integer Dim j As Integer Dim item(30) As Single Dim TheFile TheFile = Application.GetOpenFilename _ (FileFilter:="TRD Files (*.TRD), *.TRD", _ Title:="Select file to be imported") If TheFile = False Then Exit Sub Open TheFile For Binary Access Read As #1 j = 0 Do While Not EOF(1) ' Check for end of file. For i = 1 To 30 Get #1, , item(i) ' file pointer to the beginning of the next. Next i j = j + 1 ' Place on worksheet For i = 1 To 30 If i <= 26 Then NewRange = (Chr(64 + i)) & j Else: NewRange = "A" & (Chr(64 + (i - 26))) & j End If Range(NewRange).Value = item(i) Next i Loop Close #1 End Sub