Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I need some VBA code that invokes the Print dialog box. I cannot use the Printer icon in Excel to do this because every time the users need to print the current spreadsheet they first need to do a backup. They always remember to get a printout (they need the hard copy) but they forget to do a backup. This spreadsheet is updated with realtime data several times each hour so a backup is necessary. I have already implemented the VBA code in a button to do the respective backup. This button has the label "Do Backup". Now I would like to add a few lines of VBA code to the same button so that AFTER the backup is done the Print dialog box shows up. The button label would then be changed to "Do Backup and Print ..." Can you give me a few lines of VBA code that I can append to do this? Thanks, Luther ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I still need help on this.
Can you help? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In case anyone is interested, one possible answer is:
Application.Dialogs(xlDialogPrint).Show ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Luther,
I would recommend calling your backup data routine from the Worksheet_BeforePrint event. To do this, just double-click the worksheet icon in the VBE and add the following code: Private Sub Workbook_BeforePrint(Cancel As Boolean) YourBackupRoutine End Sub That way, you can just back up the workbook each time the user prints (no matter how they got there). -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] lothario wrote: Hi, I need some VBA code that invokes the Print dialog box. I cannot use the Printer icon in Excel to do this because every time the users need to print the current spreadsheet they first need to do a backup. They always remember to get a printout (they need the hard copy) but they forget to do a backup. This spreadsheet is updated with realtime data several times each hour so a backup is necessary. I have already implemented the VBA code in a button to do the respective backup. This button has the label "Do Backup". Now I would like to add a few lines of VBA code to the same button so that AFTER the backup is done the Print dialog box shows up. The button label would then be changed to "Do Backup and Print ..." Can you give me a few lines of VBA code that I can append to do this? Thanks, Luther ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would recommend calling your backup data routine from the
Worksheet_BeforePrint event. To do this, just double-click the Sorry - should have been Workbook_BeforePrint. Sorry for the confusion. -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Jake Marx wrote: Hi Luther, I would recommend calling your backup data routine from the Worksheet_BeforePrint event. To do this, just double-click the worksheet icon in the VBE and add the following code: Private Sub Workbook_BeforePrint(Cancel As Boolean) YourBackupRoutine End Sub That way, you can just back up the workbook each time the user prints (no matter how they got there). lothario wrote: Hi, I need some VBA code that invokes the Print dialog box. I cannot use the Printer icon in Excel to do this because every time the users need to print the current spreadsheet they first need to do a backup. They always remember to get a printout (they need the hard copy) but they forget to do a backup. This spreadsheet is updated with realtime data several times each hour so a backup is necessary. I have already implemented the VBA code in a button to do the respective backup. This button has the label "Do Backup". Now I would like to add a few lines of VBA code to the same button so that AFTER the backup is done the Print dialog box shows up. The button label would then be changed to "Do Backup and Print ..." Can you give me a few lines of VBA code that I can append to do this? Thanks, Luther ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Jake.
Your suggestion helped. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print Dialog box | Excel Discussion (Misc queries) | |||
VBA code: how to invoke data entry mode | Excel Programming | |||
Print dialog | Excel Programming | |||
Code to display dialog for unhiding sheets | Excel Programming | |||
Code to display dialog for unhiding sheets | Excel Programming |