I am trying to import data from an Excel sheet into Word.
But I am failing pretty quickly. Word gets stuck right at the beginning.
My code is a simple as that:
Sub ImportDataFromExcel()
Dim XLapp As Excel.Application
Set XLapp = New Excel.Application
End Sub
Here is what happens:
Excel opens up.
But Word freezes immediately. I have to force quit Word.
Word would not get to any further line of code I had included. It stops at „Set XLapp = New Excel.Application“
.
I tried a couple of things: I wrote similar code to open PowerPoint. That worked.
I wrote similar code into PowerPoint, to open Word from there. That worked.
I wrote the same code, that I posted here, into PowerPoint, to open Excel. That failed the same way!
And I also tried on a different Mac. Also there, same thing: Word freezes, when calling on Excel.
I am using Office 365 with Word and Excel for Mac, Version 16.24. As macro-reference in VBA I use the „Microsoft Excel 16.0 Object Library“. I am running MacOS Mojave (10.14.3) on my Mac.
Can anyone please help me?