- 相關(guān)推薦
使用CreateObject創(chuàng)建Excel實(shí)例
感謝 clown_ 的投遞 時(shí)間:2013-03-01 15:02 來(lái)源:三聯(lián)教程 一、使用CreateObject創(chuàng)建Excel
Sub LateBinding()
'Declare a generic object variable
Dim objExcel As Object
'Point the object variable at an Excel application object
Set objExcel = CreateObject("Excel.Application")
'Set properties and execute methods of the object
With objExcel
.Visible = True
.Workbooks.Add
.Range("A1") = "Hello World"
End With
End Sub
二、使用CreateObject創(chuàng)建指定版本的Excel實(shí)例
Sub mate()
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application.8")
End Sub
當(dāng)Create對(duì)象實(shí)例之后,就可以使用該對(duì)象的所有屬性和方法了,如SaveAs方法、Open方法、Application屬性等。
【使用CreateObject創(chuàng)建Excel實(shí)例】相關(guān)文章:
excel實(shí)訓(xùn)心得03-09
關(guān)于Excel的Hour函數(shù)介紹09-22
關(guān)于excel中的cos函數(shù)11-03
荷花語(yǔ)文教案實(shí)例10-19
什么是excel2007中的宏11-26