Impossible de fermer le process 'Excel.exe'
Bonjour,
je développe avec Visual Studio 2005, Windows XP, Office 2007.
Dans une .dll vb.net, j'ouvre un fichier excel pour y insérer des données:
Début de la .dll:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Imports Excel = Microsoft.Office.Interop.Excel
...
Private excelApp As Excel.Application = Nothing
Private excelWorkbook As Excel.Workbook = Nothing
Private excelSheets As Excel.Sheets = Nothing
Private excelWorksheet As Excel.Worksheet = Nothing
J'ai une fonction (close) qui devrai supposément fermer correctement le process Excel, il y a ceci dedans:
excelWorkbook.Close(vk_save_changes, vk_filename, vk_route_workbook)
excelWorkbook = Nothing
excelApp.Quit()
excelApp = Nothing
Dans le programme qui utilise cette .dll, j'instencie un objet de cette facon:
Dim excel As New bizExcel.ATPMain.VkExcel(False)
et je ferme cette objet de cette façon:
excel.CloseFile(True)
excel = Nothing
Return True |
Pourtant, le process EXCEL.EXE est toujours présent dans mon Task Manager et un nouveau process se rajoute chaque fois que je créer un objet excel.
Quelqu'un a une idée d'une bonne solution pour terminer correctement l'utilisation d'excel en vb.net ?
Merci
David