Bonjour
étant débutant dans comment piloter excel avec vb net,
Je n'arrive pas à fermé excel dans le gestionnaire des tâches sans à avoir à fermé mon application.
J'ai essayé beaucoup d'exemple pris sur ce site, mais en vain.
je suis sur vb net 2010
version excel 2010
Dans mon code tout se déroule bien, sauf que excel ne se ferme pas dans le gestionnaire des tâches
voici mon code
Merçi de votre attention
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
27
28
29
30 Sub test() Dim objXL4 As New Microsoft.Office.Interop.Excel.Application Dim wbXL4 As Microsoft.Office.Interop.Excel.Workbook Dim wsXL4 As Microsoft.Office.Interop.Excel.Worksheet objXL4.Visible = False wbXL4 = objXL4.Workbooks.Open("U:\Prog\Mat_and_Hole\Bonus.xls", , True) wsXL4 = objXL4.ActiveSheet wsXL4.PageSetup.Orientation = Excel.XlPageOrientation.xlPortrait '..... objXL4.Application.DisplayAlerts = False wbXL4.Close() objXL4.Quit() objXL4 = Nothing wbXL4 = Nothing wbXL4 = Nothing GC.Collect() GC.WaitForPendingFinalizers() GC.Collect() GC.WaitForPendingFinalizers() MsgBox("fin") End sub
Partager