...manchmal sind Umweg die besseren Wege!
So sieht meine Lösung jetzt aus:
DoCmd.OpenQuery "FZproLerngruppe_Kreuztabelle", acNormal, acEdit
DoCmd.RunCommand acCmdSelectAllRecords
DoCmd.RunCommand acCmdCopy
Dim xlApp As Object, xlBook As Object, xlSheet As Object
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Open("Pfad\Name.xls")
Set xlSheet = xlBook.Worksheets(1)
xlSheet.Range("A1").Select
xlSheet.PasteSpecial Format:="Biff5", Link:=False, DisplayAsIcon:= _
False
DoCmd.SetWarnings False
DoCmd.Close acQuery, "FZproLerngruppe_Kreuztabelle"
DoCmd.SetWarnings True
Die Datensätze werden also jetzt erst in die Zwischenablage kopiert und dann wird eine neue Excel-Mappe geöffnet.
Warum der ursprüngliche Weg nicht funktioniert hat, bleibt allerdings unklar.
Ciao
|