#1   Report Post  
Greg
 
Posts: n/a
Default Print Preview

Hi all, I am currently writing a program where I am just using userforms.
I am going to have the application as hidden if you know what I mean. What
I am asking is how to be able to use print preview. I have tried this but I
cant seem to make it work. The trouble is it is stalling the program
because it will not show the print preview over the top of the userform.

How can I make this work. Here is the basic code I am using

Sheets("PEGS").Select
ActiveWindow.SelectedSheets.PrintPreview

Will this work when the application is not visible?

Thanks

Greg


  #2   Report Post  
dominicb
 
Posts: n/a
Default


Good morning Greg

This should work OK, but if you have already tested it and have it
crash on you, did you have a userform open? Make sure you hide or
unload your userform before calling the print preview.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=374757

  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

I think I'd make the application visible before the printpreview, too.

Then hide it again after.

When I tried your code, the printpreview window was also hidden.

Greg wrote:

Hi all, I am currently writing a program where I am just using userforms.
I am going to have the application as hidden if you know what I mean. What
I am asking is how to be able to use print preview. I have tried this but I
cant seem to make it work. The trouble is it is stalling the program
because it will not show the print preview over the top of the userform.

How can I make this work. Here is the basic code I am using

Sheets("PEGS").Select
ActiveWindow.SelectedSheets.PrintPreview

Will this work when the application is not visible?

Thanks

Greg


--

Dave Peterson
  #4   Report Post  
Greg
 
Posts: n/a
Default

Thanks for that is it possible to get the program to resume from the same
userform which called for the preview or do I just have to have the
splashscreen show again?

Greg
"Dave Peterson" wrote in message
...
I think I'd make the application visible before the printpreview, too.

Then hide it again after.

When I tried your code, the printpreview window was also hidden.

Greg wrote:

Hi all, I am currently writing a program where I am just using
userforms.
I am going to have the application as hidden if you know what I mean.
What
I am asking is how to be able to use print preview. I have tried this
but I
cant seem to make it work. The trouble is it is stalling the program
because it will not show the print preview over the top of the userform.

How can I make this work. Here is the basic code I am using

Sheets("PEGS").Select
ActiveWindow.SelectedSheets.PrintPreview

Will this work when the application is not visible?

Thanks

Greg


--

Dave Peterson



  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

This kind of thing worked ok for me:

Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
Me.Hide
Application.Visible = True
ThisWorkbook.Worksheets("sheet1").PrintPreview
Application.Visible = False
Me.Caption = "Back from Print Preview"
Me.Show
End Sub

So just hiding and then showing should do what you want.

Greg wrote:

Thanks for that is it possible to get the program to resume from the same
userform which called for the preview or do I just have to have the
splashscreen show again?

Greg
"Dave Peterson" wrote in message
...
I think I'd make the application visible before the printpreview, too.

Then hide it again after.

When I tried your code, the printpreview window was also hidden.

Greg wrote:

Hi all, I am currently writing a program where I am just using
userforms.
I am going to have the application as hidden if you know what I mean.
What
I am asking is how to be able to use print preview. I have tried this
but I
cant seem to make it work. The trouble is it is stalling the program
because it will not show the print preview over the top of the userform.

How can I make this work. Here is the basic code I am using

Sheets("PEGS").Select
ActiveWindow.SelectedSheets.PrintPreview

Will this work when the application is not visible?

Thanks

Greg


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Greg
 
Posts: n/a
Default

Thanks Dave will give it a go

Greg
"Dave Peterson" wrote in message
...
This kind of thing worked ok for me:

Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
Me.Hide
Application.Visible = True
ThisWorkbook.Worksheets("sheet1").PrintPreview
Application.Visible = False
Me.Caption = "Back from Print Preview"
Me.Show
End Sub

So just hiding and then showing should do what you want.

Greg wrote:

Thanks for that is it possible to get the program to resume from the same
userform which called for the preview or do I just have to have the
splashscreen show again?

Greg
"Dave Peterson" wrote in message
...
I think I'd make the application visible before the printpreview, too.

Then hide it again after.

When I tried your code, the printpreview window was also hidden.

Greg wrote:

Hi all, I am currently writing a program where I am just using
userforms.
I am going to have the application as hidden if you know what I mean.
What
I am asking is how to be able to use print preview. I have tried this
but I
cant seem to make it work. The trouble is it is stalling the program
because it will not show the print preview over the top of the
userform.

How can I make this work. Here is the basic code I am using

Sheets("PEGS").Select
ActiveWindow.SelectedSheets.PrintPreview

Will this work when the application is not visible?

Thanks

Greg

--

Dave Peterson


--

Dave Peterson



  #7   Report Post  
Greg B
 
Posts: n/a
Default

Thanks everyone it works great no crashing just exactly perfect.

Greg
"Greg" wrote in message
...
Thanks Dave will give it a go

Greg
"Dave Peterson" wrote in message
...
This kind of thing worked ok for me:

Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
Me.Hide
Application.Visible = True
ThisWorkbook.Worksheets("sheet1").PrintPreview
Application.Visible = False
Me.Caption = "Back from Print Preview"
Me.Show
End Sub

So just hiding and then showing should do what you want.

Greg wrote:

Thanks for that is it possible to get the program to resume from the

same
userform which called for the preview or do I just have to have the
splashscreen show again?

Greg
"Dave Peterson" wrote in message
...
I think I'd make the application visible before the printpreview, too.

Then hide it again after.

When I tried your code, the printpreview window was also hidden.

Greg wrote:

Hi all, I am currently writing a program where I am just using
userforms.
I am going to have the application as hidden if you know what I

mean.
What
I am asking is how to be able to use print preview. I have tried

this
but I
cant seem to make it work. The trouble is it is stalling the

program
because it will not show the print preview over the top of the
userform.

How can I make this work. Here is the basic code I am using

Sheets("PEGS").Select
ActiveWindow.SelectedSheets.PrintPreview

Will this work when the application is not visible?

Thanks

Greg

--

Dave Peterson


--

Dave Peterson





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
One spreadsheet cell won't print but shows up in print preview? Sally Excel Discussion (Misc queries) 1 May 26th 05 07:06 PM
Print and Print Preview don't match screen JNohl Excel Worksheet Functions 0 March 11th 05 05:23 PM
Problems Using Print Preview Jack Excel Worksheet Functions 2 February 4th 05 05:17 PM
Print Preview trouble southsiderpgh Excel Discussion (Misc queries) 0 February 1st 05 05:47 PM
PRINT PREVIEW RON Excel Discussion (Misc queries) 1 December 16th 04 08:26 PM


All times are GMT +1. The time now is 03:29 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"