X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> How To Keep Macro Running If No Records Available For Merge Doc, Office 2013    
post Nov 26 2019, 02:07 PM

Posts: 432
Joined: 10-December 12


I have a Word macro that opens and merges 4 different Word documents with an Excel data file (the data is exported to Excel from Access). Occasionally, one of the merge documents won't have any data to merge and if that happens the macro stops with an error. Is there a way to have the Word macro continue on to the next Word document?

Go to the top of the page
post Nov 26 2019, 02:36 PM

UA Admin
Posts: 37,002
Joined: 20-June 02
From: Newcastle, WA

You should be able to handle the specific error in your Error Handler routine.

Something like this, where XXXXX represents that specific error number:

If Err = XXXXX Then
    Resume Next
    MsgBox "Bad News"
End If

My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    7th April 2020 - 08:09 PM