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


Is there a method to find out the number of pages that will be printe
with VBA code? Somehow invoking the print preview window and the
retrieving the total pages that will be printed automatically.

Thank

--
bhofset
-----------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...fo&userid=1880
View this thread: http://www.excelforum.com/showthread.php?threadid=53939

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Determining number of pages

Hi

You can use

Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")



--
Regards Ron de Bruin
http://www.rondebruin.nl


"bhofsetz" wrote in message
...

Is there a method to find out the number of pages that will be printed
with VBA code? Somehow invoking the print preview window and then
retrieving the total pages that will be printed automatically.

Thanks


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=539399



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Determining number of pages


Thanks Ron. Just what I was after

Is that similar to using BuiltinDocumentProperties ?

I found that in the Excel VBA help but was unsuccessful getting it to
return the number of pages in my worksheet.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=539399

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Determining number of pages

Hi bhofsetz

Never try it but this is not working for me

Sub Test()
With ActiveWorkbook.BuiltinDocumentProperties
MsgBox .Item("Number of pages")
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"bhofsetz" wrote in message
...

Thanks Ron. Just what I was after

Is that similar to using BuiltinDocumentProperties ?

I found that in the Excel VBA help but was unsuccessful getting it to
return the number of pages in my worksheet.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=539399



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
Number of pages in worksheet doesn't match Print Preview pages delru Excel Discussion (Misc queries) 2 May 10th 10 10:08 PM
Determining the highest number in a row Jaydubs Excel Discussion (Misc queries) 4 December 7th 05 03:10 PM
Determining the highest number in a row Jaydubs Excel Discussion (Misc queries) 1 December 7th 05 03:05 PM
need help determining a row number Gary Keramidas Excel Programming 7 November 13th 05 03:54 AM
Determining Row Number Wes Jester Excel Programming 2 August 26th 03 09:20 PM


All times are GMT +1. The time now is 02:46 AM.

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"