我们称VB用户为MORT. 这是摘自贴在我的办公室外的一个宣传广告上:
VB developers tend to work on one problem area at a time. They write code that almost works, run it to see what is wrong, fix it, and then try again until they get it right.

上周我也当了一回MORT,因为要写一个产品测试的统计报告.想用VB处理数据然后打开Excel2003并存放数据。没用过Excel所以就到处去问,要例子,一番辛苦,终于弄出来。总结一下是这么几步:

1 加入引用:Microsoft.Office.Interop.Excel

2. 在程序头加入
imports Microsoft.Office.Interop.Excel

3. 在程序中:

        Dim app As New Microsoft.Office.Interop.Excel.Application
        app.Visible = True
        Dim wrkBook As Workbook = app.Workbooks.Add()
        Dim wrkSheet As Worksheet = wrkBook.Worksheets.Add()
   
        wrkSheet.Cells(i, 1) = "My data 1"
        wrkSheet.Hyperlinks.Add(wrkSheet.Cells(i, 5), "MyLink")

Reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrtskhowtoaddnewworksheetstoworkbooks.asp

贴子现状提供且没有任何担保,同时也没有授予任何权利