Hello,

Does anyone know of a way to hide the printing dialog box that pops up during the outputTo command? I am looping through about 30 reports and saving them as excel files. During this time, the screen flickers with a dialog box stating that the file is being printed to the file location. I would like to avoid that if possible. Here is a code snippet of what I'm currently using:

VB Code:
  1. Do While Not facilitySet.EOF
  2.        
  3.         facility = facilitySet![HOSP NO]
  4.         Forms![Intro frm]![Unit No] = facility
  5.        
  6.         DoCmd.OpenReport "Facility Review Report", acViewPreview, , , acHidden
  7.    
  8.         If (Reports.Item(0).HasData <> 0) Then  'if the report has data then save it and email it
  9.             filename = "file" & facility & ".xls"
  10.             DoCmd.OutputTo acOutputReport, "Facility Review Report", "Microsoft Excel 97-2003", filename, False
  11.             EmailModule.sendEmailWithAttachment facilitySet!ContactEmail, from, "", subject, message, filename
  12.         End If
  13.    
  14.         'Close the report
  15.         DoCmd.Close acReport, "Facility Review Report", acSaveNo
  16.        
  17.         facilitySet.MoveNext
  18.     Loop

Thanks,
Ranthalion