I have the same problem, but using a Word Macro.
I think the problem is in the 64-bit ODBC Text driver.
I have opened a couple of issues with Microsoft, but have not received a helpful answer.
In my case, the 32nd time the macro does a mail merge, using the Microsoft 64-bit ODBC Text driver for MS Access, the error "Too many client tasks" appears. Perhaps each mail merge calls the ODBC driver two times?
My Word 2021 is 64-bit only and uses the 64-bit ODBC Text Driver. It cannot use the 32-bit ODBC Text Driver (or any 32-bit ODBC driver, it seems).
Attempted fixes:
- Restart the PC. That didn't help.
- Added code to close the connection from the macro, but that didn't help. The code:
ActiveDocument.MailMerge.DataSource.Close
- Download MDAC 2.8 and install it. That didn't help.
- Added a loop to add a one-second delay after every single Mail Merge. This makes the macro run a lot slower, but the same exact error happens at the 32nd Mail Merge every single time.
- I got a trial of the Progress ODBC Text Driver. This product can do at least 100 mail merges and doesn't give the "too many client tasks" error. However, if you don't define the data type for each column, it can fail if it thinks a column is a datetime, and then fail if the data is not in the format it expects.
On May 3, 2023, I opened an issue with Microsoft Support. Request Number:1053009051
Title:Getting "Too many client tasks" from Access ODBC Text Driver - From Word Macro. I provided information to duplicate the issue. Microsoft mysteriously closed my issue without any comment and did not help me. I have since followed up with them and not received help so far.
Sincerely,
Victor Reinhart