Thanks. I tried the following code and was able to generate the report, however, I was not able to successfully format the sheet. For example in the code below, the ‘Columns("A:A").EntireColumn.AutoFit” code did not work and gave me a message “Sub or function not defined. Thanks for the help.
Code:
Dim xl As Object
Set xl = CreateObject("C:\Repurchase_Report.xls")
DoCmd.OutputTo acQuery, "Repurchase_Query", "MicrosoftExcel 97-10(*.xls)", "C:\Repurchase_Report.xls", True, ""
Activesheet.select
Columns("A:A").EntireColumn.AutoFit
xl.Workbooks.Open (C:\Repurchase_Report.xls)