Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() How do I put in a warning in the macro below, like: "Is the printer ready?" and pause for an answer. If "yes", macro continues If "No", abort. Thank you. Sub PrintWithPgNumInTitleRow() Dim NumPages As Long, Pg As Long NumPages = ExecuteExcel4Macro("Get.document(50)") ActiveSheet.Range("TotalPages").Value = NumPages For Pg = 1 To NumPages With ActiveSheet .Range("PageNum").Value = Pg .PrintOut from:=Pg, to:=Pg End With Next Pg End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim Resp as long
resp = msgbox(prompt:="Really print?", buttons:=vbyesno) if resp = vbno then exit sub end if Right near the top of your code?? Teak wrote: How do I put in a warning in the macro below, like: "Is the printer ready?" and pause for an answer. If "yes", macro continues If "No", abort. Thank you. Sub PrintWithPgNumInTitleRow() Dim NumPages As Long, Pg As Long NumPages = ExecuteExcel4Macro("Get.document(50)") ActiveSheet.Range("TotalPages").Value = NumPages For Pg = 1 To NumPages With ActiveSheet .Range("PageNum").Value = Pg .PrintOut from:=Pg, to:=Pg End With Next Pg End Sub -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use something like:
If MsgBox("Is the printer ready?", vbYesNo) = vbNo Then MsgBox "OK. Nothing will be printed" Exit Sub End If For more, check XL VBA help for MsgBox. -- Regards, Tushar Mehta www.tushar-mehta.com Business solutions leveraging technology Microsoft Most Valuable Professional (MVP) 2000-2004 In article , oswald88 @singnet.com.sg says... How do I put in a warning in the macro below, like: "Is the printer ready?" and pause for an answer. If "yes", macro continues If "No", abort. Thank you. Sub PrintWithPgNumInTitleRow() Dim NumPages As Long, Pg As Long NumPages = ExecuteExcel4Macro("Get.document(50)") ActiveSheet.Range("TotalPages").Value = NumPages For Pg = 1 To NumPages With ActiveSheet .Range("PageNum").Value = Pg .PrintOut from:=Pg, to:=Pg End With Next Pg End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Another solution is to put the printer dialog for the user to determine what happend next--not easy to determine if the printer is ready unless it is next to the PC
Application.Dialogs(xlDialogPrint).Show If this returns true, the user clicked OK i.e. print else the return value is false i.e. the user clicked Cancel. In adition to this, the user can select the target printer (why always use the default?), specify the number of copies etc. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you have the appropriate software (VB or the developer version of
Office XP or later), you can create a COM add-in. Of course, it will only work with Office 2000 or later. -- Regards, Tushar Mehta www.tushar-mehta.com Business solutions leveraging technology Microsoft Most Valuable Professional (MVP) 2000-2004 In article , says... Hi All Is there any way to protect the program (my VBA program) other than use password, like in Ms Access, we can "compile" them? As we know using password is not too safe, we can find the password crack from internet? Pls give any comment! TIA Yanto |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to get rid of the warning message | Setting up and Configuration of Excel | |||
Warning Messages | Excel Worksheet Functions | |||
Pop up warning | Excel Discussion (Misc queries) | |||
warning box | Excel Worksheet Functions | |||
Warning!!! | Excel Worksheet Functions |