Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Nov 2003
    Posts
    61
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Line of code works on PC but not Mac

    This line works just fine on my PC, but when I try to run it on the Mac in their newest OS, it doesn't turn off the screenupdating. I've seen this issue pop up a few times, but I've never seen a good solution for it.

    Application.ScreenUpdating = False

    At the end of them macro I turn it back on with

    Application.ScreenUpdating = True

    I'm using this for a large macro that formats files in Word 2016, both for Mac (El Capitan) and a PC. An idea how to fix this? Turning it off would certainly make the macros run quicker.
    Last edited by Yuwipi Woman; 2016-11-08 at 15:09.

  2. #2
    Star Lounger
    Join Date
    Nov 2003
    Posts
    61
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Here's a sample of the code that I'm working on, if that helps:

    -----

    Public Sub Format()
    Dim FnType As Integer
    Dim BoldToCSC As Integer
    Dim UndToItal As Integer
    Dim FndFound As Integer
    Dim NoteCount As Integer
    Dim intParaCount As Integer

    Dim lngWorkingWith As Long
    Dim NoteLoop As Long

    Dim AdvBeforeFN As String
    Dim AdvAfterFN As String
    Dim FnSep As String
    Dim uf As String
    Dim Note As String

    Dim TrackRev As Boolean
    Dim DumbCutPaste As Boolean
    Dim Animate As Boolean
    Dim Sound As Boolean
    Dim Paginate As Boolean
    Dim Spelling As Boolean
    Dim Grammer As Boolean
    Dim Hyphenate As Boolean
    Dim booStatusBar As Boolean

    Dim Response As Variant
    Dim WindowSize As Variant
    Dim Replace As Variant
    Dim Replace1 As Variant

    Rem Dim dlg As Object
    Dim MyParagraph As Paragraph
    Rem Dim MyDialog As Dialog

    Dim intFnCount As Integer
    Rem Dim MyFNDialog As Dialog

    Rem ***** Test for open document to work on *****
    If Documents.Count > 0 Then GoTo CheckSize
    MsgBox "Please open the document you want to format and run this macro again." _
    , vbOKOnly, "Missing Document"
    Exit Sub

    CheckSize:
    WindowSize = ActiveWindow.WindowState
    If ActiveWindow.WindowState = wdWindowStateMinimize Or _
    ActiveWindow.WindowState = wdWindowStateNormal Then
    ActiveWindow.WindowState = wdWindowStateMaximize
    End If

    Rem ******DEFINES FOOTNOTE NUMBER TYPE******
    Rem Type 1 [Rtab][num][tab], num is superscript
    Rem Type 2 [Rtab][num].[tab], num is normal
    Rem Type 3 [Adv][num][Adv], num is superscript
    Rem Type 4 [Adv][num].[Adv], num is normal
    FnType = 2

    Rem *****Space to Advance if fntype 3 or 4*****
    AdvBeforeFN = "12"
    AdvAfterFN = "4"

    Rem ******M = Margin to Margin, N = None, 2 = 2 inch line******
    FnSep = "M"


    Rem ****** Setup Working Environment ******
    ActiveWindow.View.Type = wdNormalView
    Application.ScreenUpdating = False
    Rem Options.Application.DisplayStatusBar = True
    Options.CheckGrammarWithSpelling = False
    ActiveDocument.TrackRevisions = False


    Rem ******SELECTS NORMAL VIEW******

    ResetTextToBase
    ResetNotesToBase

    Rem ***copies all text & creates & inserts into setup document***
    ActiveDocument.Content.Select
    Selection.Range.Copy
    ActiveWindow.Close savechanges:=wdDoNotSaveChanges
    Documents.Add Template:="_SetMacTst16.dotm"
    ActiveWindow.View.Type = wdNormalView

    Rem Home
    Rem ActiveWindow.ActivePane.View.Type = wdMasterView

    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = "^p" + vbTab
    With .Replacement
    .Text = "^p"
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    Rem *** Replace double dash with true Mdash ***
    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = " -- "
    With .Replacement
    .Text = "^+"
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = "--"
    With .Replacement
    .Text = "^+"
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    Rem *** Change problem elipses into .hardspace. combination ***
    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = "..."
    With .Replacement
    .Text = "." & Chr(160) + "." + Chr(160) + "."
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = ""
    With .Replacement
    .Text = "." + Chr(160) + "." + Chr(160) + "."
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = ". . ."
    With .Replacement
    .Text = "." + Chr(160) + "." + Chr(160) + "."
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = " ..."
    With .Replacement
    .Text = Chr(160) & "." & Chr(160) & "." & Chr(160) & "."
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear


    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = Chr(160) + "."
    With .Replacement
    .Text = "^s."
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    Rem *** searches for 4 blanks at beginning of line and deletes them ***
    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = " "
    With .Replacement
    .Text = ""
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    Rem ******searches for 3 spaces and replaces with 2******
    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = " "
    With .Replacement
    .Text = " "
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear


    Rem ******searches for ;2 spaces and replaces with ;1 space******
    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = "; "
    With .Replacement
    .Text = "; "
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    Rem ******searches for # and replaces with #******
    Rem Home
    Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1, Name:= _
    ""
    With Selection.Find
    On Error Resume Next
    .Text = "#"
    With .Replacement
    .Text = "^s#"
    End With
    .Execute Format:=False, Replace:=wdReplaceAll
    End With
    ActiveDocument.UndoClear

    --------

    Etc......

  3. #3
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,643
    Thanks
    115
    Thanked 652 Times in 594 Posts

  4. The Following User Says Thank You to Maudibe For This Useful Post:

    Yuwipi Woman (2016-11-15)

  5. #4
    Star Lounger
    Join Date
    Nov 2003
    Posts
    61
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Thanks Maudible that was helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •