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 |
Partager