There is no coding in Asp.net which failes. It is the DTS task which failes, so the content of the produced cells is not ok. That was proofed by the last test.
I do not agree with your finding that one spreadsheet is ok. None of the sheets can be imported by DTS (btw: both are in Excel 2003 format)
The coding which produces the sheet is:
If NameFound = True Then
For I = 1 To MaxNoRow - 1
Dim CellToChange = MyWorkSheet.Cells(I, DatumColumn)
Dim NewCell As String = CellToChange.StringValue
Dim MyDateStr As String = CType(NewCell, String)
If MyDateStr <> "0" Then
' komt binnen als YYYYMMDD
' Sql server wil het zientals 28-9-2006
' Aspose ondersteund m/d/yy
MyDateStr = Left(MyDateStr, 4) + "-" + Mid(MyDateStr, 5, 2) + "-" + Right(MyDateStr, 2)
' 'Dim MyDateStrAs String = Mid(NewCell, 5, 2) + "/" + Right(NewCell, 2) + "/" + Mid(NewCell, 3, 2)
'MyWorkSheet.Cells(I, DatumColumn).Style.Custom("yyyy-mm-dd")
'Dim Message As String = MyDateStr + " "
'Me.Page.Response.Write(Message)
'MyWorkSheet.Cells(I, DatumColumn).Style.Number = 14
Else
MyDateStr = "1900-01-01"
''Dim MyDate As Date = CType(NewCell, Date)
''MyWorkSheet.Cells(I, DatumColumn).Style.Number = 14
''MyWorkSheet.Cells(I, DatumColumn).PutValue(NewCell)
End If
MyWorkSheet.Cells(I, DatumColumn).PutValue(MyDateStr)
Next
Literal3.Text = "bestand is geconverteerd"
MyWorkBook.Save(pathSchijf)
Dim MyWorkBook2 As Workbook = New Workbook
MyWorkBook2.Open(pathSchijf)
' spreadsheet is nu geopend
Dim MyWorkSheet2 As Worksheet = MyWorkBook2.Worksheets(0)
'b. opvragen aantal rijen en kolommen (RowMax, ColMax)
Dim MaxNoCol2 As Integer = MyWorkSheet.Cells.Columns.Count
Dim NoColToCopy = MaxNoCol2 +1
Dim MaxNoRow2 As Integer = MyWorkSheet.Cells.Rows.Count
Dim dt As DataTable = MyWorkSheet2.Cells.ExportDataTableAsString(1, 0, MaxNoRow2, NoColToCopy)
'nu de inhoud van
Dim ClientMaster As Workbook = New Workbook
ClientMaster.Open("c:\inetpub\wwwroot\apoonline3\ClientMaster.xls")
Dim NewWorksheet As Worksheet = ClientMaster.Worksheets(0)
' nu een copy van row 1 tot RowNoMax en van colomn 0 tot ColNoMax in een
' dataset
NewWorksheet.Cells.ImportDataTable(dt, False, 1, 0)
pathSchijf= "C:\" + CType(ApotheekParent, String) + "\klantenupload\" + "ClientMaster.xls"
ClientMaster.Save(pathSchijf)
Literal3.Text = "bestand is opgeslagen"