Consulting

Results 1 to 5 of 5

Thread: Macro suddenly stopped working.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Tutor
    Joined
    Jul 2016
    Posts
    266
    Location

    Macro suddenly stopped working.

    This macro has been working for the last year. I'm not sure what the heck is going on. It gets to the second last line "Documents.Open strOriginal" which it does complete but stops after doing so. I'm using an ACER laptop now. I have had to change other macros for use on this machine but I can't figure out why this one won't finish. Any ideas? second issue I'm having is that the documents are from a folder that asks if you want to open the document as read only so when it reopens the document it doesn't ask it just opens it as read only. There is no password protection. An help appreciated.



    Sub SaveBackUpCopy()
    Application.ScreenUpdating = False
    Const strPath As String = "C:\Users\useyourownname\Desktop\in process documents\misc\backups\" 'the path to save the copy
    Dim lFmt As Long
    Dim strOriginal As String
    With ActiveDocument
    .Save
    If .Path = "" Then
    MsgBox "The document must be saved first!"
    Exit Sub
    End If
    lFmt = .SaveFormat
    strOriginal = .FullName
    '.AcceptAllRevisions
    .TrackRevisions = False
    With ActiveWindow.View.RevisionsFilter
    .Markup = wdRevisionsMarkupNone
    .View = wdRevisionsViewFinal
    With ActiveDocument
    .Save
    End With
    End With
    .SaveAs2 FileName:=strPath & Chr(32) & .Name, _
    fileFormat:=lFmt, _
    AddToRecentFiles:=False
    .Close 0
    End With
    Documents.Open strOriginal
    Application.ScreenUpdating = True
    End Sub
    Last edited by Kilroy; 08-14-2018 at 05:25 AM.

Posting Permissions

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