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

I've just discovered my 'new' work computer doesn't have VB Help installed...
I'm trying to:

Print out a document periodically that will be a variable number of pages
tall. Sometimes, it will also be (barely) more than one page wide.
Is there a way to count the number of horizontal pages or the hpagebreaks,
so I can set the FitToPagesTall appropriately while setting FitToPagesWide =
1?
--
tj
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default count pages programmatically

Leave pages tall blank ( set it to "") Just set pages wide.

--
Regards,
Tom Ogilvy

"tjtjjtjt" wrote in message
...
I've just discovered my 'new' work computer doesn't have VB Help

installed...
I'm trying to:

Print out a document periodically that will be a variable number of pages
tall. Sometimes, it will also be (barely) more than one page wide.
Is there a way to count the number of horizontal pages or the hpagebreaks,
so I can set the FitToPagesTall appropriately while setting FitToPagesWide

=
1?
--
tj



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default count pages programmatically

Thanks, Tom. It seems I had a typo I missed. When I retyped it, I was able to
get the count--your way is, of course, better.
So, now I've got this:
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False

--
tj


"Tom Ogilvy" wrote:

Leave pages tall blank ( set it to "") Just set pages wide.

--
Regards,
Tom Ogilvy

"tjtjjtjt" wrote in message
...
I've just discovered my 'new' work computer doesn't have VB Help

installed...
I'm trying to:

Print out a document periodically that will be a variable number of pages
tall. Sometimes, it will also be (barely) more than one page wide.
Is there a way to count the number of horizontal pages or the hpagebreaks,
so I can set the FitToPagesTall appropriately while setting FitToPagesWide

=
1?
--
tj




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default count pages programmatically


How can the number of pages be determined programimatically?


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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default count pages programmatically

I needed the number of horizontal pages. Before Tom showed me a simpler
solution that fit my needs, I was using this code in a longer routine to find
the number of horizontal pages:

ActiveSheet.HPageBreaks.Count + 1


--
tj


"bhofsetz" wrote:


How can the number of pages be determined programimatically?


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




  #6   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default count pages programmatically

From: http://j-walk.com/ss/excel/tips/tip65.htm

PageCount = ExecuteExcel4Macro("Get.Document(50)")


"bhofsetz" wrote:


How can the number of pages be determined programimatically?


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


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
how to count number of pages in worksheet msnews Excel Discussion (Misc queries) 8 April 11th 08 02:39 PM
Count number of pages rm81 Excel Worksheet Functions 3 June 9th 06 05:52 PM
COUNT ACROSS SEVERAL PAGES OZDOC1050 Excel Discussion (Misc queries) 3 September 5th 05 06:28 PM
Count Pages Heather Irvin Excel Programming 2 July 13th 04 06:02 PM
Programmatically printing x pages/sheet R Avery Excel Programming 3 May 11th 04 08:21 PM


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