Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")

ExecuteExcel4Macro("GET.DOCUMENT(50)")

Is suppose to provide the number of pages to be printed. I have the
following code that reprecents two pages to print it the above code says it
is just one.

Sub PrintDirect()

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 ExecuteExcel4Macro("GET.DOCUMENT(50)") & " pages will be printed."

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

End Sub

This worked for me before and now it doesn't. Anyone know why?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 256
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")

It doesn't seem to work correctly with Zoom property set to false.
That's as much as I can figure out. I have a one-page document with
your fit settings, and the expression returns two. If I set Zoom to
100, it returns 4 which is correct. That seems to make the
difference.


On Dec 20, 11:21 am, Shawn777
wrote:
ExecuteExcel4Macro("GET.DOCUMENT(50)")

Is suppose to provide the number of pages to be printed. I have the
following code that reprecents two pages to print it the above code says it
is just one.

Sub PrintDirect()

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 ExecuteExcel4Macro("GET.DOCUMENT(50)") & " pages will be printed."

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

End Sub

This worked for me before and now it doesn't. Anyone know why?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")

Changing the Zoom didn't change anything for me.

Is there another way of counting the number of pages that are to be printed?

"ilia" wrote:

It doesn't seem to work correctly with Zoom property set to false.
That's as much as I can figure out. I have a one-page document with
your fit settings, and the expression returns two. If I set Zoom to
100, it returns 4 which is correct. That seems to make the
difference.


On Dec 20, 11:21 am, Shawn777
wrote:
ExecuteExcel4Macro("GET.DOCUMENT(50)")

Is suppose to provide the number of pages to be printed. I have the
following code that reprecents two pages to print it the above code says it
is just one.

Sub PrintDirect()

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 ExecuteExcel4Macro("GET.DOCUMENT(50)") & " pages will be printed."

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

End Sub

This worked for me before and now it doesn't. Anyone know why?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")


That xl4 function has a second argument which takes the sheet name...

ExecuteExcel4Macro("GET.DOCUMENT(50, sheetname)")

Try running it that way with a "normal" sheet active.
Include the workbook name along with the sheet name.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Shawn777"
wrote in message
ExecuteExcel4Macro("GET.DOCUMENT(50)")
Is suppose to provide the number of pages to be printed. I have the
following code that reprecents two pages to print it the above code says it
is just one.
-snip-
This worked for me before and now it doesn't. Anyone know why?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")

I tried typing in the tab name and the spreadsheet name, neither would work

The spreadsheet name is: rb3 wbu macro.xls
The tab name is: DIRECT
The path is: C:\Documents and
Settings\fogas2\Desktop\Shawn\Clients\OCC\Ring Bus 3 Val\IPA\rb3 wbu macro.xls

Could you type it in correctly so I can make sure I did it right?

"Jim Cone" wrote:


That xl4 function has a second argument which takes the sheet name...

ExecuteExcel4Macro("GET.DOCUMENT(50, sheetname)")

Try running it that way with a "normal" sheet active.
Include the workbook name along with the sheet name.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Shawn777"
wrote in message
ExecuteExcel4Macro("GET.DOCUMENT(50)")
Is suppose to provide the number of pages to be printed. I have the
following code that reprecents two pages to print it the above code says it
is just one.
-snip-
This worked for me before and now it doesn't. Anyone know why?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")


Here is the syntax I use...
(that still doesn't mean the count will be correct) <g
'---
Sub LotsOfStrings()
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 = ExecuteExcel4Macro(strFiller)
MsgBox lngCount
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Shawn777"
wrote in message
I tried typing in the tab name and the spreadsheet name, neither would work

The spreadsheet name is: rb3 wbu macro.xls
The tab name is: DIRECT
The path is: C:\Documents and
Settings\fogas2\Desktop\Shawn\Clients\OCC\Ring Bus 3 Val\IPA\rb3 wbu macro.xls
Could you type it in correctly so I can make sure I did it right?
-snip-
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")

No, it didn't work. It just returns 4 pages each time.

"Jim Cone" wrote:


Here is the syntax I use...
(that still doesn't mean the count will be correct) <g
'---
Sub LotsOfStrings()
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 = ExecuteExcel4Macro(strFiller)
MsgBox lngCount
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Shawn777"
wrote in message
I tried typing in the tab name and the spreadsheet name, neither would work

The spreadsheet name is: rb3 wbu macro.xls
The tab name is: DIRECT
The path is: C:\Documents and
Settings\fogas2\Desktop\Shawn\Clients\OCC\Ring Bus 3 Val\IPA\rb3 wbu macro.xls
Could you type it in correctly so I can make sure I did it right?
-snip-

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")


If you actually print the sheet, how many pages are printed?
Jim Cone



"Shawn777"
wrote in message
No, it didn't work. It just returns 4 pages each time.




"Jim Cone" wrote:
Here is the syntax I use...
(that still doesn't mean the count will be correct) <g
'---
Sub LotsOfStrings()
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 = ExecuteExcel4Macro(strFiller)
MsgBox lngCount
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")

2 pages are printed - the number it is suppose to be, not the number the
marco says it is. Your's says its 4 pages mine says its 1 page.

My code is below, I deactivated everything that doesn't work right.

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

"Jim Cone" wrote:


If you actually print the sheet, how many pages are printed?
Jim Cone



"Shawn777"
wrote in message
No, it didn't work. It just returns 4 pages each time.




"Jim Cone" wrote:
Here is the syntax I use...
(that still doesn't mean the count will be correct) <g
'---
Sub LotsOfStrings()
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 = ExecuteExcel4Macro(strFiller)
MsgBox lngCount
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default ExecuteExcel4Macro("GET.DOCUMENT(50)")

Hi Shawn

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 ...
2 pages are printed - the number it is suppose to be, not the number the
marco says it is. Your's says its 4 pages mine says its 1 page.

My code is below, I deactivated everything that doesn't work right.

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

"Jim Cone" wrote:


If you actually print the sheet, how many pages are printed?
Jim Cone



"Shawn777"
wrote in message
No, it didn't work. It just returns 4 pages each time.




"Jim Cone" wrote:
Here is the syntax I use...
(that still doesn't mean the count will be correct) <g
'---
Sub LotsOfStrings()
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 = ExecuteExcel4Macro(strFiller)
MsgBox lngCount
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ExecuteExcel4Macro

Make sure in your Page Setup for your worksheet, and make sure that in the scaling options, the option to 'Adjust To: x% normal size' is selected and not the 'Fit To: x pages wide' option.

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
"Document not saved" "error in loading DLL" Tracey L Excel Discussion (Misc queries) 0 December 1st 08 12:57 PM
How do I move a document from "recent items" to "documents" John Gerke in Central Oregon New Users to Excel 1 March 2nd 08 08:31 AM
ExecuteExcel4Macro "SET.PRINT.AREA" Syntax marwan Excel Programming 2 March 19th 07 07:31 PM
Retrieving info from "child" to a "parent" document create button to unhide rows Excel Discussion (Misc queries) 0 January 21st 07 10:40 PM
Solution "Your changes could not be saved" "The document may be read-only or encrypted" [email protected] Excel Discussion (Misc queries) 0 August 7th 06 06:31 AM


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