UtterAccess.com
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    
 
   
baffled100
post Nov 26 2019, 02:07 PM
Post#1



Posts: 415
Joined: 10-December 12



Hi,

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?

Thanks!
Go to the top of the page
 
GroverParkGeorge
post Nov 26 2019, 02:36 PM
Post#2


UA Admin
Posts: 36,181
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:

CODE
If Err = XXXXX Then
    Resume Next
Else
    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    11th December 2019 - 08:35 AM