|
发表于 2010-10-25 12:58:34
|
显示全部楼层
- Dim xlApp As Excel.Application
- Dim xlBook As Excel.Workbook
- Dim xlSheet As Excel.Worksheet
- Set xlApp = New Excel.Application '创建EXCEL对象
- Set xlBook = xlApp.Workbooks.Open("xxxx.xls") '打开EXCEL工作簿文件
- xlApp.Visible = False
- Set xlSheet = xlBook.Worksheets(1) '设置活动工作表
- xlSheet.Cells(2, 7)="kjhkjhkj"
- xlBook.Close False
- xlApp.Quit
- Set xlSheet = Nothing
- Set xlBook = Nothing
- Set xlApp = Nothing
复制代码 这些是基本操作方法.
使用Cells集合能定位到所需要的格子. |
|