现在写一个excel
思路:打开模板,修改,另存为。现在发现一个问题,如果我打开,直接另存为。发现进程里面excel可以关掉。
如果打开文件,修改,再另存为,进程里面excel没有被关掉。我怀疑是不是之前模板没有释放掉啊,请问有没有方法释放呢。这样是不是就会内存泄露啊?我知道如果是先copy文件,在修改可以避免这个问题,
就是想请教大家一下,这个问题这周方法能解决掉吗???code如下: Set excel_app = CreateObject("Excel.Application")
    
    '***Open the excel file.
    If Len(Dir(inBondfilename$)) > 0 Then
        excel_app.Workbooks.Open inBondfilename$
    End If******修改表格另存'***If the file exist in out put path, delete the file.
    If Len(Dir(outBondfilename$)) > 0 Then
        Kill outBondfilename$
    End If
    
    '***Save as the file
    excel_app.Workbooks(1).SaveAs outBondfilename$
   
     'Close Excel.
    excel_app.Quit
    Set excel_app = Nothing