I have a VBA macro for automatically create a word report using data in Access and Excel. The macro is hosted within a Excel document but are using both Word-, Excel and Access objects/dataTtemplates for the creation.

The errors appears what it seems randomly. The macro iterates the same code a few times even in Office 365 but then it craches. The most common error messages are:

---------------------------------------------------------

Error 1:

Run-time error '-2147417851 (80010105)':

Automation error
The server threw an exception.

---------------------------------------------------------

Error 2:

Run-time error '462':

The remote server machine does not exist or is unavailable

---------------------------------------------------------

Error 3:

This action cannot be completed because the application () is busy. Choose Switch To to activate and correct the problem.

(no options are working, this hang the application)

---------------------------------------------------------

If I debug usually the error orginates from the code where I ether close the workbook template I'm using:

excelWorkbook.Close False

... or when I paste a chart from Excel to the Word report:

wordDocument.ActiveWindow.Selection.PasteSpecial

Even more strange are that sometimes if I continue to run the macro its all working again. This ONLY happens when the client office installation is O365. Office 2013 works just fine. I thought O365 and Office 2013 was fairly equal?

Thanks in advance!