dear all,
i put this code to thisworkbook to disable print function
now, i wanna click on command button to enable print fucntion as normal![]()
Please Login or Register to view this content.
Thanks in advance
dear all,
i put this code to thisworkbook to disable print function
now, i wanna click on command button to enable print fucntion as normal![]()
Please Login or Register to view this content.
Thanks in advance
Good afternoon vumian
Something like this should help :
HTH![]()
Please Login or Register to view this content.
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
In normal module
In ThisWorkbook![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
hi all,
cld you upload exampling file,
Thank you very much
thanks all, i did successfully
dear all,
i wanna allow the printPreview thro my code is putting workbook_beforeprint inside
Thanks in advance
Hi vumian
Not sure what you mean.Originally Posted by vumian
Could you expand a little?
DominicB
OK, follow this code
I wanna click on PrintPreView, i wanna the msgbox does not appear![]()
Please Login or Register to view this content.
May it help you understand me
Thanks in advance
Last edited by vumian; 01-03-2008 at 09:30 AM.
Hi vumian
The code works fine for me when I Print Preview.Originally Posted by vumian
Where have you put the code? It needs to go in the ThisWorkbook module - this is where you have put it isn't it?
HTH
DominicB
i wanna the msgbox does not appear
The Before_Print event occurs both with Print and PrintPreview. Code can't distinguish between them. This routine cancels both Print and PrintPreview and replaces them with the PrintPreview dialog. It can be controlled with the OKtoPrint variable in the same way as the Cancel both routine posted above.
![]()
Please Login or Register to view this content.
No solution to get that 2 buttons into 2 parts separate ?
Disabeling Excel's Print also disables PrintPreview.
Rather than fiddling with the Before_Print event, you could disable both Excel's Print and PrintPreview and replace them with your own PrintPreview button and a (password protected?) Print.
One other question, if Print is disabled, why would the user want to Preview the Print they can't do?
All three of these routines assume that this is in the ThisWorkbook code module.
Each of these routines can be assigned to a button from the Forms menu.![]()
Please Login or Register to view this content.
togglePermission will only run when called by a command button. When permission is denied, neither normal Excel Print nor PrintPreview will work.
myPreview will display a PrintPreview, regardless of the status of the permission.
PrintWithPassword will print (if permission allows) or ask for a password to overide permission.
This goes in a normal module.![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks