The OpenDataSource method or property is not available because a macro is currently running

Anonymous
2023-01-03T11:16:53+00:00

Since the introduction of Word version 2211, I've had a problem with a VB.NET application that generates a data set (DAT file) and automatically merges with Word templates. I see the Word object open (with "Viewing" showing in the top right) but then closes throwing back the error

"The OpenDataSource method or property is not available because a macro is currently running."

It appears to relate to the new "Editing", "Reviewing" and "Viewing" options introduced in Word. The application uses the Microsoft interop to interact with the Word object and I believe the code it fails on is "MailMerge.OpenDataSource".

Rolling back the version to 2209 resolves the issue, so it definitely relates to functionality introduced in 2211 onwards. I've also tried in the beta channel for 2301 but that also has the same issue.

It seems that when it opens the template file, it defaults to opening in "Viewing" mode and I guess this is what is preventing the mail merge? Are there any options to prevent a document opening in "Viewing" mode? It's all done programmatically, so not sure if it would require development work on the application or if a setting can be changed in Word.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

30 answers

Sort by: Most helpful
  1. Anonymous
    2023-02-15T15:27:46+00:00

    James, I am very hopeful on this too and thanks for the preview testing. I have two sites that can try it out also. I saw that release note about a Group Policy change and wondered if that could be it. I let the group know what I found out too.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-01-30T08:34:49+00:00

    We too continue to have the same problem. We have added two statistical cases:

    • the first 64bit Office with the issue (until now we had only encountered the problem on 32-bit systems)
    • Office installed on a Windows Server, where users use our software (and so Ms Word) in RDP, a customer of us has the problem only for one remote user: for the others the same mail merge works!

    Maybe the problem could be related of some parameter or customization or security issue related to the logged user...

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2023-01-24T22:37:29+00:00

    Office Build 2212 breaks Macros needed to transfer data onto
    a Word template, so they couldn't send the entry to Word,
    preventing them from printing it

    The fix was to uninstall Office, then install build 2208
    (on the Semi-Annual Update Channel) and worked fine for us.

    -israel

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2023-01-18T22:41:06+00:00

    I’m not aware of a KB# but we think it was Release version 2211 Build 15831.20190.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2023-01-17T06:12:48+00:00

    Same here, also our customers in the last few days started to report this error elaborating a mail merge from our software. We are noticing that for us the problem seems circuscribed for win32 versions of Office (all win64 tested work). We use as a datasource for the mail merge a text file. We have the issue also in the insider preview of Office (always win32) that we are testing in a VM.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments