Enable\Disable printing from VBA macro.
To block printing operations for your workbook you should use the Additional Options | Disable printing in this workbook option. Also, you can dynamically enable\disable printing for a locked workbook from VBA code. This VBA code shows how to disable printing:
EnablePrinting( <workbook>, <IsEnable> ) method of the LockXLS Runtime object enables or disables printing. First parameter is locked workbook, second - boolean value True or False.
This call should be made only from this locked workbook. If it was made from other workbook\application, it will not make effect.
You can use similar macro to limit functionality of your workbook during trial period.
To take more complex control on the printing (for example - limit count of pages) etc., you should use Workbook_BeforePrint event.
See Also