查看完整版本: 请高手们来谈谈如何不使用DATAPOOL而调用外部文件的数据,请我们初学者也长长知识^_^

lfcooleres 2007-11-28 21:32

请高手们来谈谈如何不使用DATAPOOL而调用外部文件的数据,请我们初学者也长长知识^_^

:lol  如题!!!!

村上舞!舞!舞 2007-11-29 22:30

调用Excel文件的数据

调用Excel文件的数据.论坛中有很多相关的例子,你可以去搜索看下..

caesarqth 2007-11-29 23:36

从论坛上找的,可以参看一下   
on error resume next
    Set excel = GetObject(,"excel.application")
    if(excel Is Nothing) then
        Set excel = CreateObject("excel.application")
        if(excel Is Nothing) then
            MsgBox "Couldn't find Excel!"
            Exit Sub
        End if
    End if
   
    Set book = excel.Workbooks.Open("Your Book1.xls")
    Set worksheet = book.Worksheets("Your Excel sheet's name")
        
    For count=1 To 2
       name = worksheet.Cells(1,count).Value
       pass = worksheet.Cells(2,count).Value      
    Next count
    'Quit Excel'''''''''''''''''''''
    excel.Quit
    Set excel = Nothing

lfcooleres 2007-11-30 21:09

谢谢了^_^
页: [1]
查看完整版本: 请高手们来谈谈如何不使用DATAPOOL而调用外部文件的数据,请我们初学者也长长知识^_^