Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default How many pages will be printed?

Is there any way of getting the number of pages that are to be printed in VBA.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How many pages will be printed?

Hi Shawn777

See how I use it here
http://www.rondebruin.nl/print.htm#not

TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn777" wrote in message ...
Is there any way of getting the number of pages that are to be printed in VBA.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default How many pages will be printed?

I've been working with that code and it doesn't produce the correct pages to
be printed. It use to work months ago - now I changed the macro and it
doesnt work right.

Below is my code, as you can see I've been trying different options with no
luck.

Sub PrintAreaDirect()

'Dim strWB As String
'Dim strName As String
'Dim strFiller As String
'Dim lngCount As Long

'strWB = "[" & ActiveWorkbook.Name & "]"
'strName = Worksheets(23).Name
'strFiller = "get.document(50,""" & strWB & strName & """)"
'lngCount = Application.ExecuteExcel4Macro(strFiller)

Sheets("DIRECT").Select

Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!Enlarge"
Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!ReduceDir"
ActiveSheet.ResetAllPageBreaks
ActiveSheet.PageSetup.PrintArea = "$B$1:$N$199"
With ActiveSheet.PageSetup
.CenterHorizontally = True
.Orientation = xlLandscape
.FitToPagesWide = 1
End With
Range("H1").Select

MsgBox Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") & " pages will
be printed."

' If ExecuteExcel4Macro("GET.DOCUMENT(50)") < 1 Then
Rows("59:59").Select
Range("B59").Activate
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=ActiveCell
Application.Run "PrintPage"
' Else
' Application.Run "PrintPage"
' End If

End Sub

"Ron de Bruin" wrote:

Hi Shawn777

See how I use it here
http://www.rondebruin.nl/print.htm#not

TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn777" wrote in message ...
Is there any way of getting the number of pages that are to be printed in VBA.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How many pages will be printed?

Hi Shawn

Oops I posted it first in your other thread

Difficult to see the problem from here.
Do you have the problem also with more workbooks ?


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn777" wrote in message ...
I've been working with that code and it doesn't produce the correct pages to
be printed. It use to work months ago - now I changed the macro and it
doesnt work right.

Below is my code, as you can see I've been trying different options with no
luck.

Sub PrintAreaDirect()

'Dim strWB As String
'Dim strName As String
'Dim strFiller As String
'Dim lngCount As Long

'strWB = "[" & ActiveWorkbook.Name & "]"
'strName = Worksheets(23).Name
'strFiller = "get.document(50,""" & strWB & strName & """)"
'lngCount = Application.ExecuteExcel4Macro(strFiller)

Sheets("DIRECT").Select

Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!Enlarge"
Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!ReduceDir"
ActiveSheet.ResetAllPageBreaks
ActiveSheet.PageSetup.PrintArea = "$B$1:$N$199"
With ActiveSheet.PageSetup
.CenterHorizontally = True
.Orientation = xlLandscape
.FitToPagesWide = 1
End With
Range("H1").Select

MsgBox Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") & " pages will
be printed."

' If ExecuteExcel4Macro("GET.DOCUMENT(50)") < 1 Then
Rows("59:59").Select
Range("B59").Activate
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=ActiveCell
Application.Run "PrintPage"
' Else
' Application.Run "PrintPage"
' End If

End Sub

"Ron de Bruin" wrote:

Hi Shawn777

See how I use it here
http://www.rondebruin.nl/print.htm#not

TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn777" wrote in message ...
Is there any way of getting the number of pages that are to be printed in VBA.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default How many pages will be printed?

Yes, I had it in another spreadsheet and thought it was working fine. I
tested it the other day and it did the same thing this one is. It may have
always been a problem that snuck by.

Im going on X-mas vacation soon, so I may not respond for about two weeks
when I get back.

I was going over that webpage you sent and may have found an answer to
another problem I have. This one needs to work first though.

"Ron de Bruin" wrote:

Hi Shawn

Oops I posted it first in your other thread

Difficult to see the problem from here.
Do you have the problem also with more workbooks ?


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn777" wrote in message ...
I've been working with that code and it doesn't produce the correct pages to
be printed. It use to work months ago - now I changed the macro and it
doesnt work right.

Below is my code, as you can see I've been trying different options with no
luck.

Sub PrintAreaDirect()

'Dim strWB As String
'Dim strName As String
'Dim strFiller As String
'Dim lngCount As Long

'strWB = "[" & ActiveWorkbook.Name & "]"
'strName = Worksheets(23).Name
'strFiller = "get.document(50,""" & strWB & strName & """)"
'lngCount = Application.ExecuteExcel4Macro(strFiller)

Sheets("DIRECT").Select

Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!Enlarge"
Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!ReduceDir"
ActiveSheet.ResetAllPageBreaks
ActiveSheet.PageSetup.PrintArea = "$B$1:$N$199"
With ActiveSheet.PageSetup
.CenterHorizontally = True
.Orientation = xlLandscape
.FitToPagesWide = 1
End With
Range("H1").Select

MsgBox Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") & " pages will
be printed."

' If ExecuteExcel4Macro("GET.DOCUMENT(50)") < 1 Then
Rows("59:59").Select
Range("B59").Activate
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=ActiveCell
Application.Run "PrintPage"
' Else
' Application.Run "PrintPage"
' End If

End Sub

"Ron de Bruin" wrote:

Hi Shawn777

See how I use it here
http://www.rondebruin.nl/print.htm#not

TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn777" wrote in message ...
Is there any way of getting the number of pages that are to be printed in VBA.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default How many pages will be printed?

I believe I figured out how it worked before and not now. When I insert a
page break it works correctly. When I reset all the page breaks and the
computer inserts the page breaks accordingly it doesn't count all of the
pages and comes up short on the page count.

Is there another way of counting pages?

"Ron de Bruin" wrote:

Hi Shawn

Oops I posted it first in your other thread

Difficult to see the problem from here.
Do you have the problem also with more workbooks ?


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn777" wrote in message ...
I've been working with that code and it doesn't produce the correct pages to
be printed. It use to work months ago - now I changed the macro and it
doesnt work right.

Below is my code, as you can see I've been trying different options with no
luck.

Sub PrintAreaDirect()

'Dim strWB As String
'Dim strName As String
'Dim strFiller As String
'Dim lngCount As Long

'strWB = "[" & ActiveWorkbook.Name & "]"
'strName = Worksheets(23).Name
'strFiller = "get.document(50,""" & strWB & strName & """)"
'lngCount = Application.ExecuteExcel4Macro(strFiller)

Sheets("DIRECT").Select

Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!Enlarge"
Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!ReduceDir"
ActiveSheet.ResetAllPageBreaks
ActiveSheet.PageSetup.PrintArea = "$B$1:$N$199"
With ActiveSheet.PageSetup
.CenterHorizontally = True
.Orientation = xlLandscape
.FitToPagesWide = 1
End With
Range("H1").Select

MsgBox Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") & " pages will
be printed."

' If ExecuteExcel4Macro("GET.DOCUMENT(50)") < 1 Then
Rows("59:59").Select
Range("B59").Activate
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=ActiveCell
Application.Run "PrintPage"
' Else
' Application.Run "PrintPage"
' End If

End Sub

"Ron de Bruin" wrote:

Hi Shawn777

See how I use it here
http://www.rondebruin.nl/print.htm#not

TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn777" wrote in message ...
Is there any way of getting the number of pages that are to be printed in VBA.



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 will be printed Jon Excel Discussion (Misc queries) 0 November 17th 08 09:24 AM
Column names on all printed pages TimJim Excel Worksheet Functions 1 February 28th 07 02:18 AM
Watermark on all printed pages in Excel Kathrine Excel Discussion (Misc queries) 5 November 28th 06 04:47 PM
i would like that my first line to appear in all printed pages hagar Excel Discussion (Misc queries) 1 February 27th 06 12:44 PM
headers across printed pages Myrna Larson Excel Worksheet Functions 1 October 3rd 05 10:03 PM


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