我的主页 http://263.csdn.net/edyang/ Download 区有个 ExcelAuto 的例子,可能对你有所帮助。

解决方案 »

  1.   

    已解决!代码如下分只好加给XIAODAO自己了。。呵。
    Private Sub Command1_Click()
        Dim AppExcel As Object
        Dim wSheet As Worksheet
        On Error Resume Next
        Set AppExcel = GetObject(, "excel.application")
        If Err.Number <> 0 Then
            Set AppExcel = CreateObject("excel.application")
            Err.Clear
        End If
        On Error GoTo 0
        With AppExcel
            .Workbooks.Open "d:\test.xls"
        End With
        Set wSheet = AppExcel.Workbooks("test.xls").Sheets(1)
        With wSheet
            MsgBox .Cells(1, 1)
            .Cells(1, 2) = 2
            MsgBox .Cells(1, 2)
        End With
        AppExcel.Workbooks("test.xls").Close savechanges:=False
        AppExcel.Quit
    End Sub
      

  2.   

    MY GOD!新问题又来了,怎样把分加给自已?回答有分。:)
      

  3.   

    dragonleon,我的把分加给了你,还得时候别忘记了付利息