I tried this out this afternoon - first chance!!!
Didn't work at first but realised I had to check Excel in the references.
The code I have is
_____________________
Dim cnn As ADODB.Connection
Dim xlApp As Excel.Application
Dim clSheet As Excel.Worksheet
' Delete the old copies of the export files so that the new files only have one worksheet each
Kill "C:\MgmShp\Export\MgmShpExp.xls"
Kill "C:\MgmShp\Export\MgmShpWeekFix.xls"
' Export the data to Excel files in the C:\ directory
DoCmd.TransferSpreadsheet acExport, 8, "qxtbExport", "C:\MgmShp\Export\MgmShpExp.xls", True, ""
DoCmd.TransferSpreadsheet acExport, 8, "tblWeekFix", "C:\MgmShp\Export\MgmShpWeekFix.xls", True, ""
' Manipulate the spreadsheet to fix pane at cell B2
Set xlApp = CreateObject("Excel.Application")
xlApp.Application.Visible = False
xlApp.Workbooks.Open "C:\MgmShp\Export\MgmShpExp.xls"
Sheets("qxtbExport").select
qxtbExport.range("B2").Activate
ActiveWindow.FreezePanes = True
ActiveWorkbook.Save
xlApp.Application.Visible = True
Set xlSheet = Nothing
Set xlApp = Nothing
' Update the download check in tblWeekControl
Set cnn = CurrentProject.Connection
cnn.Execute "UPDATE [tblWeekControl] INNER JOIN [tblWeekFix] ON ([tblWeekControl].[lngWcYear] = [tblWeekFix].[lngYearFix]) AND ([tblWeekControl].[bytWcWeek] = [tblWeekFix].[bytWeekFix]) SET [tblWeekControl].[bExport] = Yes;"
Set cnn = Nothing
MsgBox "The tables have been successfully exported", vbOKOnly, "Progress information"
____________________
I get an error message saying object required, but it seems to have locked me out of the spreadsheet. When I opened it read-only it hasn't got as far as freezing the pane.
I tried commenting out the ActiveWorkbook.Save line, since I wasn't sure that was meant to be there, and re-running it but it denied me permission!
Any ideas what I have got wrong??
Thanks for any clues
Malcy