I wrote this chunk of VBA code to take a text file, import it, clean it up,
drop it into a number of spots on a worksheet, export a chunk of the
worksheet and email the export to a particular addy, and then print preview
other worksheets with the resulting data. In 2003 I used
Allplication.ScreenUpdating to turn off the wild switching to and from
different worksheets and files in the process. When I opened the same
workbook in excel 2007 it seemed to still work but I lost some functionality.
For example, if I left ScreenUpdating as False, I'd lose the ribbon across
the top on the print preview screens. Trouble is, if I set it to True just
before I tell it to ActiveWindow.SelectedSheets.PrintPreview, the ribbon
returns but it doesn't have the buttons on the ribbon enabled (so I can't
clock the print or the close buttons). Is there something I can add to the
code so this will work properly in 2007 but won't change functionality in XP
and 2003? The code in question is:
Application.ScreenUpdating = True
ActiveWindow.SelectedSheets.PrintPreview
Application.ScreenUpdating = False
Thanks!
|