以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 导入excel,执行app.quit命令,excel在进程中并没有完全退出 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=127736) |
-- 作者:kgdce -- 发布时间:2018/11/21 0:58:00 -- 导入excel,执行app.quit命令,excel在进程中并没有完全退出 导入excel,执行app.quit命令,excel在进程中并没有完全退出,是什么原因?如何解决? Dim App As New MSExcel.Application Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("C:\\Users\\wuyong\\Desktop\\试验数据\\A.xls") Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1) Dim Rg As MSExcel.Range = Ws.UsedRange Dim x As Integer = Rg.Rows.Count Dim y As Integer = Rg.Columns.Count Dim arr1(0 To x,0 To y) As Object arr1 = Rg.value Dim arr(0 To x-1,0 To y-1) As String For h1 As Integer =1 To x For h2 As Integer =1 To y arr(h1-1,h2-1)=arr1(h1,h2) Next Next arr1 = Nothing wb.save App.Quit |
-- 作者:有点甜 -- 发布时间:2018/11/21 8:48:00 -- 试试改成
app.DisplayAlerts = false wb.save
App.Quit
|
-- 作者:洮沙 -- 发布时间:2023/9/4 13:00:00 -- 学习! [此贴子已经被作者于2023/9/4 13:00:15编辑过]
|