Forum Discussion
guifernandes1607
Sep 06, 2022Copper Contributor
Word Blocked Macros
Hi We created some macros to fill in a Word document according to information provided by a third party software called Protheus. The macros were working perfectly, but as of last week, after some W...
Sep 14, 2022
marbel1492 This issue is caused when you use CreateObject to create an instance of Word when the Word application is already running.
Modify the code in your Access application so that it uses a construction of the following format to access the existing instance of Word if there is one.
Dim bstartApp As Boolean
On Error Resume Next
Set objWord = GetObject(, "Word.Application")
If Err Then
bstartApp = True
Set objWord = CreateObject("Word.Application")
End If
On Error GoTo 0
'Then, at the end of your code incorporate
If bstartApp = True Then
objWord.Quit
End If
DPyleOR
Feb 08, 2023Copper Contributor
Doug_Robbins_Word_MVP . I want to say thank you for presenting a fix for the macro disabling issue. The code change from createobject() to getobject() absolutely solved my issue.