Word Macro Keeps Running After SaveAs Dialog Box Despite F8

I am debugging a Microsoft Word macro on a Win 7 PC.  After the dlg.Show (sixth step below) when I click the OK button on the SaveAs dialog box, it runs continuously until finished despite the fact I hit F8.  Tried 3x now.  It never used to do this.  I haven't changed anything in the script for over a month.  Not sure how I'm supposed to debug the script when it won't continue step by step with F8.  Suggestions?


    '-----------
    Dim dlg As Dialog
    'Dim sFileName As String
    'sFileName = SaveCDP_Value & "_rr.doc"
    Set dlg = Dialogs(wdDialogFileSaveAs)
    dlg.Name = strFileName
    dlg.Show
    '-----------
       
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "^t"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.Delete Unit:=wdCharacter, Count:=1
    Selection.HomeKey Unit:=wdStory, Extend:=wdExtend
    Selection.Cut
LVL 2
rvfowler2Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Selection might not be set, and the script execution is stopped completely. What's your On Error setting?
0
rvfowler2Author Commented:
There is no selection set or "On Error" setting that I know of.  F8 or Step Into works fine, stepping through one line at a time until I get to the SaveAs step, then after I click OK, it continues throughout the rest of the macro, almost as if I hit F5 "Continue." See screen print.
-WordMacro.jpg
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Are you certain the remaining lines are executed?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

rvfowler2Author Commented:
Yes, because I can see how they effect the Word document that is open right in front of me.
0
rvfowler2Author Commented:
Very strange.  Never used to do that.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
How about setting a breakpoint at one of the "skipped" lines? Does that work at least?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rvfowler2Author Commented:
There weren't any "skipped" lines.  Problems is that it just keeps running through the lines even though I only pressed F8 for Step Info which usually processes one line a time.  However, took your advice and set a breakpoint, and that worked.  After I clicked OK on the SaveAs dialog box, it only ran to the breakpoint and stopped.  At least now I have a way of stopping it.  Thanks.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
That's what I meant. But I've still no clue why F8 does not work.
0
rvfowler2Author Commented:
Thanks for the help.  At least setting a breakpoint works.  Will keep researching why F8 Step Into no longer goes one line at a time.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.