VB.NET 操作excel后,进程还是在的,这是什么原因?网上找了很多方法都不行,求解。
Dim xlApp As Microsoft.Office.Interop.Excel.Application
Dim xlBook As Microsoft.Office.Interop.Excel.Workbook
Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
xlApp = New Microsoft.Office.Interop.Excel.Application
xlBook = xlApp.Workbooks.Open("C:\Users\LI\Desktop\学生成绩.xlsx")
xlSheet = xlBook.Sheets("Sheet1")
Dim S1 As String
xlSheet.Range("A2").Value = "大家好!"
S1 = xlSheet.Range("A2").Value '为了验证,读取并显示它
MsgBox(S1)
xlApp.ActiveWorkbook.Close(SaveChanges:=True)
xlApp.Quit()
xlApp = Nothing