

However, here I find that CreateObject only works sometimes, and I haven't been able to work out why. If you don't, you'll see see a compile-time error anyway and VBA won't actually run the code).Īnd to use CreateObject (if Word is not already running or when you you need a new instance of Word, on Windows at least) or GetObject (when you want to connect to a/the existing instance of Word. (It doesn't matter whether or not you have defined the correct reference in VBE Tools->References. So you cannot use Dim wdApp As New Word.Document In Excel, trying to use an early-bound object of type Word.Application always fails. The problems are a bit different depending on which application you are running or trying to automate. Here, (same Office version, but Mac OS Catalina 10.15.6) what I find is that. I have done clean installs of Office on clean installs of Mac OS and encountered and reported the problems, and that's when I think the software author should really investigate the problem and provide fix or a workaround. However, I have never seen a support document by anyone, including Microsoft, that tells you how to fix that. The usual suspect would be "something to do with Mac OS Sandboxing".

The trouble is that not everyone seems to experience these problems, which suggests that they could result from a configuration issue. You may have seen similar questions elsewhere. There have been problems using COM Automation (which is what New Word.Application", CreateObject etc are doing) on the Mac versions of Office for some years now. ActiveDocument.SaveAs2 Environ("UserProfile") & "\Desktop\MovieReport.docx" ParagraphFormat.Alignment = wdAlignParagraphLeft ParagraphFormat.Alignment = wdAlignParagraphCenter

The line that needs debugging: Set wdApp = New Word.Application

I was able to open tools-references-and select the Word library, but now References is unhighlighted and unclickable. I am now using Mac OS Majave 10.14.6 and Word/Excel version 16.41. I am starting from scratch on a different computer and operating system. Language version: Word/Excel version 16.41 I am trying to run an Excel VBA subroutine to save a Word document.
