Screen updating macro

Rated 4.57/5 based on 872 customer reviews

Each time a cell that affects any formula in your spreadsheet is changed or manipulated, Excel recalculates the entire worksheet.

Hence I created this generic wrapper to lock the window updates.

Declare Function Find Window Lib "user32" Alias "Find Window A" _ (By Val lp Class Name As String, _ By Val lp Window Name As Long) As Long ' Use Lock Window Update to prevent/enable window refresh Declare Function Lock Window Update Lib "user32" _ (By Val hwnd Lock As Long) As Long ' Use Update Window to force a refresh of the Power Point window Declare Function Update Window Lib "user32" (By Val hwnd As Long) As Long Property Let Screen Updating(State As Boolean) Static hwnd As Long Dim Version No As String ' Get Version Number If State = False Then Version No = Left(Application. Version, ".") - 1) ' Get handle to the main application window using Class Name Select Case Version No Case "8" ' For PPT97: hwnd = Find Window("PP97Frame Class", 0&) Case "9" ' For PPT2K: hwnd = Find Window("PP9Frame Class", 0&) Case "10" ' For XP: hwnd = Find Window("PP10Frame Class", 0&) Case "11" ' For 2003: hwnd = Find Window("PP11Frame Class", 0&) Case "12" ' For 2007: hwnd = Find Window("PP12Frame Class", 0&) Case "14" ' For 2010: hwnd = Find Window("PPTFrame Class", 0&) Case "15" ' For 2013: hwnd = Find Window("PPTFrame Class", 0&) Case Else Err.

Raise Number:=vb Object Error ERR_VERSION_NOT_SUPPORTED, _ Description:="Newer version." Exit Property End Select If hwnd = 0 Then Err.

Raise Number:=vb Object Error ERR_NO_WINDOW_HANDLE, _ Description:="Unable to get the Power Point Window handle" Exit Property End If If Lock Window Update(hwnd) = 0 Then Err.

Raise Number:=vb Object Error ERR_WINDOW_LOCK_FAIL, _ Description:="Unable to set a Power Point window lock" Exit Property End If Else ' Unlock the Window to refresh Lock Window Update (0&) Update Window (hwnd) hwnd = 0 End If End Property 'Sample Usage: Sub Long Processing Sub() ' Lock screen redraw Screen Updating=False ' --- Long time consuming code ' Redraw screen again Screen Updating=True ' Also see below article for another example of usage of the code End Sub It's fairly simple to open a Power Point file (*.ppt) for editing using VBA code however opening a Power Point Show (*.pps) file for editing is altogether another matter. Open method and it defaults to open the file in Slide Show mode. The routine below illustrates a manner of woring around the default behaviour and opening the file for editing.

Leave a Reply

  1. Absolutely free no cc xxx cams 27-Aug-2017 21:22

    Users can find what they are looking for or create their own ad for free. Oodle Oodle is one of the largest classifieds sites that aggregates listings from sites like e Bay, For Rent.com, Myspace, as well as listings from local newspapers and websites.

  2. Virusfreie sex cam 07-Jan-2018 06:50

    Enjoy their 30 to 45 minutes stripping show on your desktop.

  3. tips for dating a recovering addict 05-Jul-2017 13:05

    A historic seaport and popular summer tourist destination, Portsmouth was the home of the Strategic Air Command's Pease Air Force Base, later converted to Portsmouth International Airport at Pease with limited commercial air service.

  4. Free 1to1 cams 05-Dec-2017 06:03

    It also would imply that the average monthly signup rate since the hack has been north of 750,000 — a huge number by the standards of most any dating app these days. “In the summer of 2015 we experienced unprecedented media coverage of our business” — and unprecedented signups despite the hacking scare, according to Keable.