Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RPW RPW is offline
external usenet poster
 
Posts: 52
Default PrintPreview problem

Hi,

I have a macro that uses the following code snippet that worked fine in 2003
and XP.

Set Wsh = Worksheets("Summary Sheet")
Wsh.Activate 'Needs to be activate for PrintPreview
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect
Wsh.Visible = xlSheetVisible
Wsh.Activate
Wsh.PrintPreview

Now with 2007, the preview is right but the problem is that there is no way
to print from this mode. I can exit the preview with the "Esc" key or
"Ctrl-c" but "Ctrl-P" does not do anything and the "Office Button" (and the
Print Menus) and all Ribbon access is unavailable.

How can I modify the code so that the user can print the preview? Or will I
have to duplicate the entire macro, create a new control button, and edit the
macro to Print (rather than printpreview)?
--
rpw
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default PrintPreview problem

Sub PrintPreview()
ActiveWindow.SelectedSheets.PrintPreview

End Sub

"rpw" wrote:

Hi,

I have a macro that uses the following code snippet that worked fine in 2003
and XP.

Set Wsh = Worksheets("Summary Sheet")
Wsh.Activate 'Needs to be activate for PrintPreview
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect
Wsh.Visible = xlSheetVisible
Wsh.Activate
Wsh.PrintPreview

Now with 2007, the preview is right but the problem is that there is no way
to print from this mode. I can exit the preview with the "Esc" key or
"Ctrl-c" but "Ctrl-P" does not do anything and the "Office Button" (and the
Print Menus) and all Ribbon access is unavailable.

How can I modify the code so that the user can print the preview? Or will I
have to duplicate the entire macro, create a new control button, and edit the
macro to Print (rather than printpreview)?
--
rpw

  #3   Report Post  
Posted to microsoft.public.excel.programming
RPW RPW is offline
external usenet poster
 
Posts: 52
Default PrintPreview problem

Thanks for the response Mike. Unfortunately I get the same results whether
the method is "ActiveWindow.SelectedSheets.PrintPreview" or
"Wsh.PrintPreview".

It appears that for some unknown reason using the PrintPreview method
disables Excel 2007's ability to print from the preview.

Perhaps someone at Microsoft is reading this and has an answer? Or an Excel
MVP knows of a simple workaround?
--
rpw


"Mike" wrote:

Sub PrintPreview()
ActiveWindow.SelectedSheets.PrintPreview

End Sub

"rpw" wrote:

Hi,

I have a macro that uses the following code snippet that worked fine in 2003
and XP.

Set Wsh = Worksheets("Summary Sheet")
Wsh.Activate 'Needs to be activate for PrintPreview
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect
Wsh.Visible = xlSheetVisible
Wsh.Activate
Wsh.PrintPreview

Now with 2007, the preview is right but the problem is that there is no way
to print from this mode. I can exit the preview with the "Esc" key or
"Ctrl-c" but "Ctrl-P" does not do anything and the "Office Button" (and the
Print Menus) and all Ribbon access is unavailable.

How can I modify the code so that the user can print the preview? Or will I
have to duplicate the entire macro, create a new control button, and edit the
macro to Print (rather than printpreview)?
--
rpw

  #4   Report Post  
Posted to microsoft.public.excel.programming
RPW RPW is offline
external usenet poster
 
Posts: 52
Default PrintPreview problem

Aha! I have located the problem: Application.ScreenUpdating = False

If this is set to 'True' in 2007 then there is no problem with the preview
(but the display transition is not as smooth as in XP)
--
rpw


"Mike" wrote:

Sub PrintPreview()
ActiveWindow.SelectedSheets.PrintPreview

End Sub

"rpw" wrote:

Hi,

I have a macro that uses the following code snippet that worked fine in 2003
and XP.

Set Wsh = Worksheets("Summary Sheet")
Wsh.Activate 'Needs to be activate for PrintPreview
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect
Wsh.Visible = xlSheetVisible
Wsh.Activate
Wsh.PrintPreview

Now with 2007, the preview is right but the problem is that there is no way
to print from this mode. I can exit the preview with the "Esc" key or
"Ctrl-c" but "Ctrl-P" does not do anything and the "Office Button" (and the
Print Menus) and all Ribbon access is unavailable.

How can I modify the code so that the user can print the preview? Or will I
have to duplicate the entire macro, create a new control button, and edit the
macro to Print (rather than printpreview)?
--
rpw

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PrintPreview Gerry Verschuuren Excel Discussion (Misc queries) 5 October 23rd 07 06:24 PM
.PrintPreview André Boileau Excel Programming 2 February 9th 07 02:31 AM
Print dialog : problem when user click printpreview François Excel Programming 6 April 19th 06 07:04 AM
printpreview Alex Excel Programming 5 September 12th 05 10:26 PM
Printpreview problem - disable various buttons Raymond Excel Programming 1 April 7th 05 10:17 PM


All times are GMT +1. The time now is 06:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"