gjay1688 发表于 2009-3-12 10:13:02

对excel操作后的关闭

Set conn = CreateObject("ADODB.Connection")
Set rst = CreateObject("ADODB.RecordSet")

完成对其的操作后,对他们进行关闭的话,应该怎么写?
1.rst.Close Set rst = Nothing
2.rst.Close Set rst = Nothing
conn.Close Set conn = Nothing
3.rst.Close Set conn = Nothing

huyongdidai 发表于 2009-3-17 23:31:01

VBScript中的Excel文件读写

Set xlApp = CreateObject ("Excel.Application")
Set xlFile = xlApp.Workbooks.Open (“ c:\qtp_file\data.xls")
Set xlSheet = xlFile.Sheets("Sheet1")

Set xlSheet = Nothing
Set xlFile = Nothing
Set xlApp = Nothing

dreamever 发表于 2009-3-18 09:24:12

应该在set xlSheeet = nothing之前再写上一句xlFile.close() ,释放占用的IO资源
页: [1]
查看完整版本: 对excel操作后的关闭