使用CreateObject创建Excel实例

时间:2022-10-05 14:02:35 网络知识 我要投稿
  • 相关推荐

使用CreateObject创建Excel实例

  感谢 clown_ 的投递 时间:2013-03-01 15:02 来源:三联教程   一、使用CreateObject创建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创建指定版本的Excel实例

  Sub mate()

  Dim objExcel As Object

  Set objExcel = CreateObject("Excel.Application.8")

  End Sub

  当Create对象实例之后,就可以使用该对象的所有属性和方法了,如SaveAs方法、Open方法、Application属性等。

【使用CreateObject创建Excel实例】相关文章:

excel实训心得03-09

关于Excel的Hour函数介绍09-22

Excel日期和时间函数11-27

关于Excel工程函数大全11-27

关于excel中的cos函数11-03

荷花语文教案实例10-19

实例论证雅思的写作方法10-15

如何让Excel表格行列自动求和11-27

什么是excel2007中的宏11-26

怎么更改Excel迭代公式的次数04-13