Imports System
Imports System
ComponentModel
Imports Excel = Microsoft.Office.Interop.Excel
End Try
End Sub
With oSheet
.Range("A1").Value = "Initial Temperature, °C"
.Range("B1").Value = sngInitTemp
.Range("A2").Value = "Surrounding Temperature, °C"
.Range("B2").Value = sngSurrTemp
.Range("C1").Value = "Time, s"
.Range("D1").Value = "Current Temperature, °C"
End With
'Column A
For intCounter As Integer = 0 To (intSteps - 1)
'Added +2 to intCounter to start at row 2 since row 1 is for the
heading
oSheet.Cells(intCounter + 2, 3).value = intCounter * sngTimeInt
Next
'Column B
For intCounter As Integer = 0 To (intSteps - 1)
oSheet.Cells(intCounter + 2, 4).formula = "=$B$2+($B$1-$B$2)*EXP(-"
& sngK & "*C" & intCounter + 2 & ")"
If intCounter = 3 And sngK = 0.1 Then oSheet.Cells(5, 4).Formula =
"=$B$2+($B$1-$B$2)*EXP(-0.1*C5)"
Next