Probleme mit Application.quit
23.06.2013 17:25:47
Norman
Habe folgenden Code:
Private Sub CommandButton1_Click()
Dim app As Excel.Application
Set app = New Excel.Application
Dim wb As Workbook
Set wb = app.Workbooks.Add(ThisWorkbook.Path & "\Test.xlt")
Set wb = Nothing
Set app = Nothing
Application.Quit
End Sub
Meine Meinung war, dass dadurch, dass ich eine neue Excel-Instanz erzeuge, beim Application.quit die aktuelle Excel-Instanz geschlossen wird, die "neue" (aus app) aber offen bleibt. Dem ist aber nicht so, es gehen beide zu. Ich möchte aber die Excel-Instanz, in der der Code ausgeführt ist, schließen, während die andere offen bleibt.
Geht das und wenn ja wie?
Bin für Tipps dankbar :)
Gruß
Norman