1、
Workbooks.Open Filename:= _
        "C:\Documents and Settings\Administrator\My Documents\Book2.xls"
    Sheets("Sheet2").Select2、
SELECT *
FROM sysobjects
WHERE (xtype = 'u')

解决方案 »

  1.   

    先在工程中选中 Ms  9.0 excel object ,即对EXCEL的引用
     
        Dim xlApp As Excel.Application
        Dim wbzhishu As Excel.Workbook
        Dim shtzhishu As Excel.Worksheet    On Error Resume Next
            Set xlApp = GetObject(, "Excel.Application")
            If Err.Number <> 0 Then
                Set xlApp = CreateObject("Excel.Application")
            End If
            Err.Clear
        
        Set wbzhishu = xlApp.Workbooks.Open(filename1)
        Set shtzhishu = wbzhishu.Sheets("sheet2")