e có 1 file .xlam, trong thisworkbook có đoạn mã này:
Option Explicit
Public WithEvents ExcelApp As Application
Private Sub Workbook_Open()
Set ExcelApp = Application
End Sub
'gọi sub trước khi in
Private Sub ExcelApp_WorkbookBeforePrint(ByVal wb As Workbook, Cancel As Boolean)
MsgBox...