I generate an Excel file from within Access 2010 with this code:
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
With xlApp
.Visible = True
.DisplayAlerts = False
.Save TrimFrom("Right", CurrentDb.Name, "") & "Stamtræ.xlsx"
.DisplayAlerts = True
.Quit
End With
Set xlBook = Nothing
Set xlApp = Nothing
But I get a message when opening again that the format or extension is wrong !!!!!
What is wrong her ?