|
4#
楼主 |
发表于 2005-12-27 17:30:38
|
只看该作者
Sub Main
Dim Result As Integer
dim excel as Object
dim book as Object
dim worksheet as Object
dim s_name as String
dim s_pass as String
dim count as Integer
'Initially Recorded: 2005-8-2 9:36:33
'Script Name: gn1
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("test.xls")
Set worksheet = book.Worksheets("test")
end sub
当我运行这段程序时,弹出提示信息(见附件),什么原因.错误出在"Set excel = GetObject(,"Excel.application")" |
|