Try
Dim myabc As Object
myabc = System.Runtime.InteropServices.Marshal.GetActiveObject("excel.Application")
For i = 0 To myabc.Application.Workbooks.Count - 1
MsgBox(myabc.Application.Workbooks(1).name)'可以通过文件名判断关闭指定excel
myabc.Application.Workbooks.close
Next
' Process.GetProcesses("excel.exe")(0).Kill()
Catch ex As Exception
MsgBox(ex.Message)
End Try
转载请注明出处: 未经允许不得转载:lxfamn » vb.net 批量关闭excel 关闭指定excel