G
Guest
hi i have a windows service that uses an excell workbook
when i create the excell app
i cant distroy it after i am finished i am using this code
whats wrong?
thanks
Dim processes1(), p1 As Process
Try
processes1 = Process.GetProcesses()
For Each p1 In processes1
If Not (p1.MainModule Is Nothing) Then
If
System.IO.Path.GetFileName(p1.MainModule.FileName).ToLower() = "excel.exe"
Then
Try
p1.Close()
'p1.CloseMainWindow()
Catch er1 As Exception
MsgBox(er1)
End Try
'Exit For
End If
End If
Next
Catch ex As SystemException
MsgBox(ex.message)
End Try
when i create the excell app
i cant distroy it after i am finished i am using this code
whats wrong?
thanks
Dim processes1(), p1 As Process
Try
processes1 = Process.GetProcesses()
For Each p1 In processes1
If Not (p1.MainModule Is Nothing) Then
If
System.IO.Path.GetFileName(p1.MainModule.FileName).ToLower() = "excel.exe"
Then
Try
p1.Close()
'p1.CloseMainWindow()
Catch er1 As Exception
MsgBox(er1)
End Try
'Exit For
End If
End If
Next
Catch ex As SystemException
MsgBox(ex.message)
End Try