对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
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 应该在set xlSheeet = nothing之前再写上一句xlFile.close() ,释放占用的IO资源
页:
[1]