View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rockee052[_28_] Rockee052[_28_] is offline
external usenet poster
 
Posts: 1
Default Printing during select times

Hey,

I have a code that I did myself :) (small steps), I tried setting it u
where it would only allow the user to print during select times. M
goal was to set it up where the file could only print between 8am
Noon.. I can't figure out the code to be between certain times.

Any help will be appriciated

Private Sub Workbook_BeforePrint (Cancel As Boolean)
Select Case Time
Case Is TimeSerial(12, 0, 0)
msg = "You do not need to print at this time!"
Ans = "MsgBox(msg, vbInformation, "Cannot Print...")
Cancel = True
End Select
Exit Sub
msg = "Is the Shift Report completed and accurate?"
Ans = MsgBox(msg, vbYesNo, "About to print...")
If Ans = vbNo Then Cancel = True
End Sub


Thanks,

Rockee Freema

--
Message posted from http://www.ExcelForum.com