如何使用Excel对象处理数据?

上一篇 / 下一篇  2007-05-22 16:48:35 / 个人分类:EXCELL


  Dim xl
  打开excel文件
  Function OpenExcelFile(strFilePath)
  Set xl = CreateObject("Excel.Application")
  xl.Workbooks.Open strFilePath
  End Function
  获得指定单元格数据
  Function GetCellData(strSheet,rwIndex,colIndex)
  GetCellData = xl.WorkSheets(strSheet).Cells(rwIndex,colIndex)
  End Function
  填充单元格数据
  Function PutCellData(strSheet,rwIndex,colIndex,varData)
  xl.WorkSheets(strSheet).Cells(rwIndex,colIndex) = varData
  End Function
  保存并推出
  Function SaveAndQuit()
  xl.Activeworkbook.save
  xl.Quit
  Set xl = nothing
  End Function

TAG: EXCELL

 

评分:0

我来说两句

日历

« 2024-04-30  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 41512
  • 日志数: 55
  • 图片数: 6
  • 书签数: 1
  • 建立时间: 2007-05-22
  • 更新时间: 2007-12-12

RSS订阅

Open Toolbar