I've got an array that is used to create a binary file. This file has a certain format to it (26 bytes per record) but for it to write 1068 items (size of array) takes 35 seconds??? If I create a file for Output and add the same values is takes 1 second???

I can't see why it takes so long to create the binary file? Can anyone help shed some light on this for me?

VB Code:
  1. Public Sub CreateDataManFile(tMainData() As TypeGraphData)
  2. Dim intFile As Integer
  3. Dim DataManFile As String
  4. Dim sString As String * 14
  5. Dim i As Long
  6. Dim j As Integer
  7. Dim dateDay As Byte
  8. Dim dateMonth As Byte
  9. Dim dateYear As Integer
  10. DataManFile = App.Path & "\Lintz.mmd"
  11.  
  12.     'Check if dataman file exists and if so delete it
  13.     If Dir$(DataManFile) <> "" Then
  14.     Kill DataManFile
  15.     End If
  16.  
  17. intFile = FreeFile
  18. Open DataManFile For Binary Access Write As #intFile
  19.        
  20. Debug.Print "Start Time Without Date = " & Now
  21.        
  22.     For i = 0 To UBound(tMainData) '1068 items
  23.    
  24.     Put #intFile, LOF(intFile) + 1, tMainData(i).fAmt
  25.    
  26.         'This gets the day, month, year depending on users regional settings
  27.     Call GetCurrentDate(dateDay, dateMonth, dateYear, CDate(tMainData(i).dDate))
  28.    
  29.         'fill in 18 bytes as data inbetween is not used
  30.         j = 5
  31.         Do Until j = 23
  32.         Put #intFile, LOF(intFile) + 1, CByte(0)
  33.         j = j + 1
  34.         Loop
  35.    
  36.         'Add Day
  37.         Put #intFile, LOF(intFile) + 1, dateDay
  38.        
  39.         'Add Month
  40.         Put #intFile, LOF(intFile) + 1, dateMonth
  41.        
  42.         'Add Year
  43.         Put #intFile, LOF(intFile) + 1, dateYear
  44.        
  45.     DoEvents
  46.     Next
  47.    
  48.     Close #intFile
  49. Debug.Print "End Time = " & Now '35 seconds
  50.    
  51. End Sub