LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default Help with Printing Userforms

Hi All,
I'm having diffilculty in Printing my Userforms to a specific
printer.

The Code I've used previously to print sections of a worksheet is as follows:

Sub CmdPrint()
Dim Printb as Boolean

ActiveSheet.PageSetup.PrintArea = "$HG$7:$HM$16"
Printb = Application.Dialogs(xlDialogPrinterSetup).Show
If Printb = True Then ' Print only if OK Button is pressed
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("calculations").Visible = False
ActiveWorkbook.Protect Password:=Passwd

Elseif Printb = False Then ' Cancells Print operation
Sheets("calculations").Visible = False
ActiveWorkbook.Protect Password:=Passwd
End sub

When printing a userform I tried to use the code:
Sub PrintReports1

Dim Printb as Boolean
Printb = Application.Dialogs(xlDialogPrinterSetup).Show
If Printb = True Then
DailyReports1.PrintForm
Elseif Printb = False Then ' Cancells Print operation
ActiveWorkbook.Protect Password:=Passwd
End if

But this seems to send the data to a different Printer than requested, but
it seems to be alway the same one, but this is an old Printer that no longer
exists. I know i can uninstall this printer but this in it'self wouldn't
solve the problem.

Can anyone advise me on where I've gone wrong with the code, I need to use
the xlDialogPrinterSetup due to the end Users PC's having different Printer
Configurations setups.

Regards
Lee
 
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
Printing UserForms leerem Excel Discussion (Misc queries) 1 November 20th 08 10:35 PM
Help with Userforms Panagiotis Marantos Excel Discussion (Misc queries) 2 July 25th 06 04:26 PM
I need some help with userforms T.c.Goosen1977 Charts and Charting in Excel 0 June 30th 06 09:29 AM
I need some help with userforms T.c.Goosen1977 Excel Discussion (Misc queries) 0 June 30th 06 09:27 AM
UserForms bennyob Excel Discussion (Misc queries) 4 November 7th 05 01:58 PM


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