Mail merge Word/Excel Dilaogue/Database Engine error

H

havenlad

A client is having major problems doing a mail-merge. Every time I try to
open the document I get an error message stating "this operation cannot be
completed because of dialog or database engine failures. please try later"

Anybody's help would do me a huge favour

Thanks

Chris
 
P

Peter Jamieson

Which version of Word?

Has this merge worked before?

Can you spell out what is going wrong, e.g. can you disconnect? Can you
reconnect? Does the problem occur when you connect/reconnect or only when
you open the document?

Is the Excel file being used by anything else?

(Do you have access to the client's machine?)

Peter Jamieson
 
H

havenlad

Thanks Peter

Word 2003
Yes she can disconnect - that is the only workaround she has.
The merge has worked before, and it has failed before - it is intermittent.
(it failed when she logged into my machine)
The problem is only when she opens the document
The |Excel file ihas never been moved and it is not in use elsewhere
I do have access to the machine.

Hope all that helps
 
P

Peter Jamieson

I don't know what the problem is, but if it's intermittent and only occurs
when the document is opened, I would try to go the macro route, i.e.
a. create an AutoOpen macro in the document, say

Sub AutoOpen()

Dim strPathName As String
Dim strSheetRangeName As String
Dim strQuery As String

' Put the pathname of your Excel workbook here
strpathName = "c:\myworkbooks\mywb.xls"

' Put the name of the Sheet (or the range name) here
strSheetRangeName = "Sheet1$"

' Construct the Query - you may also need WHERE and ORDER BY
' clauses for filtering and sorting

strQuery = _
"SELECT * FROM `" & _
strSheetRangeName & _
"`"

' The following should be enough in Word 2003

ActiveDocument.MailMerge.OpenDataSource _
Name:=strPathName, _
SQLStatement:=strQuery

' Set the merge type you want
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters

' optionally set the destination you want
ActiveDocument.MailMerge.Destination = wdSendToNewDocument

End Sub

b. ensure the data source is disconnected from the document (click the
first button in the Mail Merge toolbar and check the Normal Word Document
option)
c. save the document

When the user has finished with the document, she either needs to close the
mail merge main document without saving it, or do (b) then (c).

Unfortunately you will probably also have to take account of the following
KB article:

"Opening This Will Run the Following SQL Command" Message When You Open a
Word Document"
at
http://support.microsoft.com?kbid=825765

As for the cause of the existing problem, I can only offer a few ideas:
a. the Excel document might be corrupt
b. the Excel document might be very large (I don't run into that myself)
c. Is the Excel document on a network path?
d. is the Excel document path name long?
e. are sort/filter options specified? (but I think this only caused a
problem in Office XP)
f. is the user using a network roaming profile? If so, there is a
possibilty that there is a permissions problem with a temporary file/folder
somewhere.

Peter Jamieson
 
P

Peter Jamieson

Ah. Way too deep for me - sorry i really don't understand anything in
that
answer

I hoped you might at least understand stuff such as

and be able to set up some simple tests that might reveal problems in those
areas (e.g. experiment using a newly-created, small, definitely not corrupt
Excel file as the data source)
but let's look at this a different way.

At the moment, the user opens the document (is that just using Word
File|Open, or what?). Then she sometimes sees the error.

If she sees the error, she can disconnect, then reconnect, and it then works
(I think - is that correct?).

After that, has she saved the Mail Merge Main Document? If not, can she do
that and see if that makes a difference (I don't see why it should, but it
is the first thing to try).

Finally, can you spell out what you meant by:

?

Peter Jamieson
 
H

havenlad

Thanks for your patience

I did understand those basic parts, but the Macro parts are way too deep.

There are a few spreadsheets they use for the mail merges. The problem
occurs with several of them, not just one. They vary in size. I will ask
her to copy and paste the excel file to another location and copy and paste
it back to the original location and will ak they do this each time it
happens for a few days at least.

I will ask her to try the things suggested.

Spot on about the reconnect.

She logged into my machine with her account and tried the mail merge from
there. The problem followed, which rules out a problem on her machine. A
colleqgue then logged in on his machine and the same thing happened to him,
so it's not a machine or account problem

Hope this helps
 
P

Peter Jamieson

I did understand those basic parts, but the Macro parts are way too deep.

Understood.

Let's see how things go.

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top