如何在vb.net 中把数据存入到excel中?
还请高手多多指教啊!
Module Module1
Sub Main()
Dim excel As Excel.ApplicationClass = New Excel.ApplicationClass
Dim wb As Excel.WorkbookClass
Dim ws As Excel.Worksheet
wb = excel.Workbooks.Open("C:\Documents and Settings\work\Desktop\ConsoleApplication1\Yang")
wb.Activate()
ws = wb.Worksheets.Add
excel.Visible = True
Dim ran As RandomUniform = New RandomUniform
ran.randomSetSeed(10)
Dim i As Integer
For i = 1 To 10
ws.Cells(i, 3).Value = ran.randomUniform()
Next
ws.Cells(1, 2).Value = excel.WorksheetFunction.Sum(excel.Range("C1:C10"))
End Sub
End Module