Application.DisplayAlerts = False ActiveWindow.SelectedSheets.PrintOut From:=1, To:=32766, Copies:=1, ActivePrinter:="PDFCreator" 'on imprime la feuille active 'ThisWorkbook.PrintOut Copies:=1, ActivePrinter:="PDFCreator"
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, lpRect As Long, ByVal bErase As Long) As Long Private Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function GetDesktopWindow Lib "user32" () As Long Public Function fncScreenUpdating(State As Boolean, Optional Window_hWnd As Long = 0) Const WM_SETREDRAW = &HB Const WM_PAINT = &HF If Window_hWnd = 0 Then Window_hWnd = GetDesktopWindow() Else If IsWindow(hwnd:=Window_hWnd) = False Then Exit Function End If End If If State = True Then Call SendMessage(hwnd:=Window_hWnd, wMsg:=WM_SETREDRAW, wParam:=1, lParam:=0) Call InvalidateRect(hwnd:=Window_hWnd, lpRect:=0, bErase:=True) Call UpdateWindow(hwnd:=Window_hWnd) Else Call SendMessage(hwnd:=Window_hWnd, wMsg:=WM_SETREDRAW, wParam:=0, lParam:=0) End If End Function
fncScreenUpdating State:=False ActiveWindow.SelectedSheets.PrintOut From:=1, To:=32766, Copies:=1, ActivePrinter:="PDFCreator" fncScreenUpdating State:=True
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question