ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   BeforePrint event (https://www.excelbanter.com/excel-programming/388760-beforeprint-event.html)

Dave Shaw

BeforePrint event
 
I have the following macro in Excel 2003:

Private Sub workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

The aim is to prevent printing. It does not seem to do anything but I don't
know why. Can anyone help?

Thanks

Dave

Tom Ogilvy

BeforePrint event
 
Have events been disabled - or macros disabled.

--
regards,
Tom Ogilvy


"Dave Shaw" wrote:

I have the following macro in Excel 2003:

Private Sub workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

The aim is to prevent printing. It does not seem to do anything but I don't
know why. Can anyone help?

Thanks

Dave


Dave Shaw

BeforePrint event
 
Macros are enabled and I think events are enabled:

Med = Application.EnableEvents

results in True.


"Tom Ogilvy" wrote:

Have events been disabled - or macros disabled.

--
regards,
Tom Ogilvy


"Dave Shaw" wrote:

I have the following macro in Excel 2003:

Private Sub workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

The aim is to prevent printing. It does not seem to do anything but I don't
know why. Can anyone help?

Thanks

Dave


Tom Ogilvy

BeforePrint event
 
If events work and macros are enabled bad that code is in the ThisWorkbook
module, I would expect that to block the printing of information in the
sheets of that workbook.

--
Regards,
Tom Ogilvy


"Dave Shaw" wrote:

Macros are enabled and I think events are enabled:

Med = Application.EnableEvents

results in True.


"Tom Ogilvy" wrote:

Have events been disabled - or macros disabled.

--
regards,
Tom Ogilvy


"Dave Shaw" wrote:

I have the following macro in Excel 2003:

Private Sub workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

The aim is to prevent printing. It does not seem to do anything but I don't
know why. Can anyone help?

Thanks

Dave



All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com