Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default print preview

hi there folks!!!

i am working on a project that uses vba scripts to test features of

excel.


my problem is this.

i have to check if the user has inserted a header and aligned it right
in a specific worksheet.



i can do that no problem.


then i am asked to check if the user has hit the print preview button
and that the worksheet is in the print preview mode.



when i record a macro that puts a workesheet in print preview what i
get from the recorded macro is this


ActiveWindow.SelectedSheets.PrintPreview.



how can i check that the user has left his worksheet in print preview
mode?


i hope you understand


please help!!!!!!!!!



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default print preview

Nikolaos,

query the Printpreview property of the relevant sheet,
like this:

Dim PPviewOn as boolean

If activesheet.printpreview = true then
PPview = True
... your code here ...
Else
PPview = False
... alternative code here ...
End IF

Cheers, Pete
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default print preview

That always returned false for me - of course printpreview doesn't return
anything until the sheet is out of printprint preview.

--
Regards,
Tom Ogilvy

"Pete McCosh" wrote in message
...
Nikolaos,

query the Printpreview property of the relevant sheet,
like this:

Dim PPviewOn as boolean

If activesheet.printpreview = true then
PPview = True
... your code here ...
Else
PPview = False
... alternative code here ...
End IF

Cheers, Pete



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default print preview

Ah...

I didn't realise that, I just played around with querying
the value and setting it to true, then made up the rest of
my example without actually trying it. That should be a
lesson for me!

After a brief interlude, I now see that the VBE is
disabled when in Print preview mode. Is there any way for
Nikoloas to do what he wants?

Pete

-----Original Message-----
That always returned false for me - of course

printpreview doesn't return
anything until the sheet is out of printprint preview.

--
Regards,
Tom Ogilvy


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default print preview

I don't think the object model provides any direct way to do that. I
believe any workaround would depend on detecting the user initiating a
command that would take them into printpreview mode.

--
Regards,
Tom Ogilvy

"Pete McCosh" wrote in message
...
Ah...

I didn't realise that, I just played around with querying
the value and setting it to true, then made up the rest of
my example without actually trying it. That should be a
lesson for me!

After a brief interlude, I now see that the VBE is
disabled when in Print preview mode. Is there any way for
Nikoloas to do what he wants?

Pete

-----Original Message-----
That always returned false for me - of course

printpreview doesn't return
anything until the sheet is out of printprint preview.

--
Regards,
Tom Ogilvy






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
Plot Area Automatically Expands in Print and Print Preview Myk D. Charts and Charting in Excel 2 March 12th 09 01:41 PM
First page of Excel sheerepeats in print layout or print preview philfrotonda Excel Discussion (Misc queries) 1 July 12th 07 09:28 PM
Print and Print Preview Graphic Moving Resizing 2007/2003 Adam Rayburn Excel Discussion (Misc queries) 0 April 4th 07 04:18 PM
print preview v page break preview SamB Excel Discussion (Misc queries) 0 November 16th 06 05:09 PM
cell borders that I create dont show on print preview or print scott3435 Excel Discussion (Misc queries) 2 April 6th 06 02:37 AM


All times are GMT +1. The time now is 10:00 PM.

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

About Us

"It's about Microsoft Excel"