关于GetObject( , class )
大家能给解释一下GetObject(, class )这个函数吗?帮助不是很理解 理解OLE2 object吗?可以先去看看这个相关的资料,再来看函数就好理解了 好的 Sub MainDim 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-29: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")" 你首先要打开一个excel,你还是没明白帮助里的意思
页:
[1]