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

Good afternoon. I used VBA to format the pages I want printed.
However, when they press the Print icon I developed for them, I want
the xlDialogPrint to appear so they can select an appropriate printer.
The xlDialogPrint box appears, but I only want them to use the dialog
box to select a printer. Once they select the printer and press OK,
the worksheets will print based on the print definitions in the VBA. I
don't want them to be able to adjust any of the other arguments, as
I've already defined those arguments in the VBA code. Is it possible
for me to use VBA code to disable all arguments of the xlDialogPrint
box, except the printer selection argument? Thanks for your time.

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default xlDialogPrint

Application.Dialogs(xlDialogPrinterSetup).Show

--
Jim
wrote in message
...
| Good afternoon. I used VBA to format the pages I want printed.
| However, when they press the Print icon I developed for them, I want
| the xlDialogPrint to appear so they can select an appropriate printer.
| The xlDialogPrint box appears, but I only want them to use the dialog
| box to select a printer. Once they select the printer and press OK,
| the worksheets will print based on the print definitions in the VBA. I
| don't want them to be able to adjust any of the other arguments, as
| I've already defined those arguments in the VBA code. Is it possible
| for me to use VBA code to disable all arguments of the xlDialogPrint
| box, except the printer selection argument? Thanks for your time.
|
| Michael

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default xlDialogPrint

Maybe you could create your own dialog that only lists available
printers...

http://support.microsoft.com/kb/q166008/

Cliff Edwards
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default xlDialogPrint

How about using a different dialog?

Application.Dialogs(xlDialogPrinterSetup).Show



" wrote:

Good afternoon. I used VBA to format the pages I want printed.
However, when they press the Print icon I developed for them, I want
the xlDialogPrint to appear so they can select an appropriate printer.
The xlDialogPrint box appears, but I only want them to use the dialog
box to select a printer. Once they select the printer and press OK,
the worksheets will print based on the print definitions in the VBA. I
don't want them to be able to adjust any of the other arguments, as
I've already defined those arguments in the VBA code. Is it possible
for me to use VBA code to disable all arguments of the xlDialogPrint
box, except the printer selection argument? Thanks for your time.

Michael


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default xlDialogPrint

On Sep 9, 12:27*pm, "Jim Rech" wrote:
Application.Dialogs(xlDialogPrinterSetup).Show

--
wrote in message

...
| Good afternoon. I used VBA to format the pages I want printed.
| However, when they press the Print icon I developed for them, I want
| the xlDialogPrint to appear so they can select an appropriate printer.
| The xlDialogPrint box appears, but I only want them to use the dialog
| box to select a printer. Once they select the printer and press OK,
| the worksheets will print based on the print definitions in the VBA. I
| don't want them to be able to adjust any of the other arguments, as
| I've already defined those arguments in the VBA code. Is it possible
| for me to use VBA code to disable all arguments of the xlDialogPrint
| box, except the printer selection argument? Thanks for your time.
|
| Michael


Thanks, Jim. The xlDialogPrinterSetup allows me to select a printer.
Once I press OK, though, the worksheets do not print.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default xlDialogPrint

Have your code print what you want.

Activesheet.printout
'or
ActiveSheet.Range("a1:x99").PrintOut
'or
activewindow.SelectedSheets.printout



" wrote:

On Sep 9, 12:27 pm, "Jim Rech" wrote:
Application.Dialogs(xlDialogPrinterSetup).Show

--
wrote in message

...
| Good afternoon. I used VBA to format the pages I want printed.
| However, when they press the Print icon I developed for them, I want
| the xlDialogPrint to appear so they can select an appropriate printer.
| The xlDialogPrint box appears, but I only want them to use the dialog
| box to select a printer. Once they select the printer and press OK,
| the worksheets will print based on the print definitions in the VBA. I
| don't want them to be able to adjust any of the other arguments, as
| I've already defined those arguments in the VBA code. Is it possible
| for me to use VBA code to disable all arguments of the xlDialogPrint
| box, except the printer selection argument? Thanks for your time.
|
| Michael


Thanks, Jim. The xlDialogPrinterSetup allows me to select a printer.
Once I press OK, though, the worksheets do not print.


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default xlDialogPrint

Jim/Dave, Thanks guys.

This solved a problem for me. However, when the cancel button is press it
still prints. Is there a way to have the print request cancelled. Here's
what I have

Sub PrintSelection()
'
' Print Selected Range Macro
'

Dim LastRow As Long

Application.ScreenUpdating = False

With Worksheets("Jobs")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With


Application.Dialogs(xlDialogPrinterSetup).Show

ActiveSheet.Range("A3:P" & LastRow).PrintOut

Range("A3").Select

Application.ScreenUpdating = True
End Sub

Cheers
--
Jim


"Dave Peterson" wrote:

How about using a different dialog?

Application.Dialogs(xlDialogPrinterSetup).Show



" wrote:

Good afternoon. I used VBA to format the pages I want printed.
However, when they press the Print icon I developed for them, I want
the xlDialogPrint to appear so they can select an appropriate printer.
The xlDialogPrint box appears, but I only want them to use the dialog
box to select a printer. Once they select the printer and press OK,
the worksheets will print based on the print definitions in the VBA. I
don't want them to be able to adjust any of the other arguments, as
I've already defined those arguments in the VBA code. Is it possible
for me to use VBA code to disable all arguments of the xlDialogPrint
box, except the printer selection argument? Thanks for your time.

Michael


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default xlDialogPrint

The cancel button tells you that the user didn't want to change printers--not
that they didn't want to print.

Maybe you could show this dialog and remove your .printout statement:

Application.Dialogs(xlDialogPrint).Show

Or you could ask:

dim resp as long
....
Application.Dialogs(xlDialogPrinterSetup).Show
resp = Msgbox(Prompt:="still want to print", buttons:=vbyesno)
if resp = vbyes then
ActiveSheet.Range("A3:P" & LastRow).PrintOut
end if



Jim G wrote:

Jim/Dave, Thanks guys.

This solved a problem for me. However, when the cancel button is press it
still prints. Is there a way to have the print request cancelled. Here's
what I have

Sub PrintSelection()
'
' Print Selected Range Macro
'

Dim LastRow As Long

Application.ScreenUpdating = False

With Worksheets("Jobs")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With


Application.Dialogs(xlDialogPrinterSetup).Show

ActiveSheet.Range("A3:P" & LastRow).PrintOut

Range("A3").Select

Application.ScreenUpdating = True
End Sub

Cheers
--
Jim

"Dave Peterson" wrote:

How about using a different dialog?

Application.Dialogs(xlDialogPrinterSetup).Show



" wrote:

Good afternoon. I used VBA to format the pages I want printed.
However, when they press the Print icon I developed for them, I want
the xlDialogPrint to appear so they can select an appropriate printer.
The xlDialogPrint box appears, but I only want them to use the dialog
box to select a printer. Once they select the printer and press OK,
the worksheets will print based on the print definitions in the VBA. I
don't want them to be able to adjust any of the other arguments, as
I've already defined those arguments in the VBA code. Is it possible
for me to use VBA code to disable all arguments of the xlDialogPrint
box, except the printer selection argument? Thanks for your time.

Michael


--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default xlDialogPrint

Thanks Dave, as usual, perfectly simple.

I haven't run it in the office yet but the cancel dialog was just what I was
looking for.
--
Jim


"Dave Peterson" wrote:

The cancel button tells you that the user didn't want to change printers--not
that they didn't want to print.

Maybe you could show this dialog and remove your .printout statement:

Application.Dialogs(xlDialogPrint).Show

Or you could ask:

dim resp as long
....
Application.Dialogs(xlDialogPrinterSetup).Show
resp = Msgbox(Prompt:="still want to print", buttons:=vbyesno)
if resp = vbyes then
ActiveSheet.Range("A3:P" & LastRow).PrintOut
end if



Jim G wrote:

Jim/Dave, Thanks guys.

This solved a problem for me. However, when the cancel button is press it
still prints. Is there a way to have the print request cancelled. Here's
what I have

Sub PrintSelection()
'
' Print Selected Range Macro
'

Dim LastRow As Long

Application.ScreenUpdating = False

With Worksheets("Jobs")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With


Application.Dialogs(xlDialogPrinterSetup).Show

ActiveSheet.Range("A3:P" & LastRow).PrintOut

Range("A3").Select

Application.ScreenUpdating = True
End Sub

Cheers
--
Jim

"Dave Peterson" wrote:

How about using a different dialog?

Application.Dialogs(xlDialogPrinterSetup).Show



" wrote:

Good afternoon. I used VBA to format the pages I want printed.
However, when they press the Print icon I developed for them, I want
the xlDialogPrint to appear so they can select an appropriate printer.
The xlDialogPrint box appears, but I only want them to use the dialog
box to select a printer. Once they select the printer and press OK,
the worksheets will print based on the print definitions in the VBA. I
don't want them to be able to adjust any of the other arguments, as
I've already defined those arguments in the VBA code. Is it possible
for me to use VBA code to disable all arguments of the xlDialogPrint
box, except the printer selection argument? Thanks for your time.

Michael

--

Dave Peterson


--

Dave Peterson

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default xlDialogPrint

Thanks Cliff,
I only have a simple P to P network this time around so this might be a bit
of overkill. However, this in an interesting article I'll file for future
reference. Thanks for the link.

--
Jim


"ward376" wrote:

Maybe you could create your own dialog that only lists available
printers...

http://support.microsoft.com/kb/q166008/

Cliff Edwards

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 read settings from xlDialogPrint John G.[_4_] Excel Programming 1 August 4th 08 05:49 PM
need to access the xldialogprint object parameters Alex281 Excel Programming 5 September 13th 06 05:41 AM
application.dialogs(xlDialogPrint) - arguments David Excel Programming 0 October 17th 05 08:01 AM
Controlling the 'cancel' button in xldialogprint JNW Excel Programming 1 September 15th 05 09:08 PM
VBA : xlDialogPrint function Gilbert Aponte[_2_] Excel Programming 0 October 15th 03 12:23 AM


All times are GMT +1. The time now is 11:51 AM.

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

About Us

"It's about Microsoft Excel"