Hi all,
A client of mine asked me to update an MS Access file.
The file is in Access 2000 format, they use Access 2002, but I used Access 2003 to perform the required modifications.
After I finished my work (everything works fine in my workstation) I tried to run in the client workstation. Everything does its job except one small part that was one of the few things that I didn't change. The ideia of that part is to generate a Word mailmerge operation and one of the steps is to use MS Word to open a txt file and save it as a doc. The code (that rests intact) is the following:
DoCmd.TransferText acExportMerge, , qry, fileName & ".txt"
On Error Resume Next
Kill fileName & ".doc"
On Error GoTo Err_ExportaDoc
' wd is declared as a Word.Application object and doc is declared as a Word.Document object
Set doc = wd.Documents.Open(fileName & ".txt", False, , , , , , , , wdOpenFormatText)
doc.SaveAs fich & ".doc", wdFormatDocument
doc.Close
The error occurs when the code hits "Open" and the error message is:
Automation Error - The server threw an exception
When I run this code using the old version it works fine, if I run it on my workstation (Access 2003 and Win XP Home edition) it is also OK, but if I run it on client's workstation (Access 2002, Win XP Professional) it throws me that error.
I runed it several times in debug mode and the wd object is always well created and it is the same object as used in the old version (that works fine). Besides that I cheked VBA references and all are exactly the same as the file version that works. I think that this should be a configuration problem but I still can not find it...
Can anyone help me on that? I spent almost one week searching for the solution and I'm still lost...
Thanks in advance.
A client of mine asked me to update an MS Access file.
The file is in Access 2000 format, they use Access 2002, but I used Access 2003 to perform the required modifications.
After I finished my work (everything works fine in my workstation) I tried to run in the client workstation. Everything does its job except one small part that was one of the few things that I didn't change. The ideia of that part is to generate a Word mailmerge operation and one of the steps is to use MS Word to open a txt file and save it as a doc. The code (that rests intact) is the following:
DoCmd.TransferText acExportMerge, , qry, fileName & ".txt"
On Error Resume Next
Kill fileName & ".doc"
On Error GoTo Err_ExportaDoc
' wd is declared as a Word.Application object and doc is declared as a Word.Document object
Set doc = wd.Documents.Open(fileName & ".txt", False, , , , , , , , wdOpenFormatText)
doc.SaveAs fich & ".doc", wdFormatDocument
doc.Close
The error occurs when the code hits "Open" and the error message is:
Automation Error - The server threw an exception
When I run this code using the old version it works fine, if I run it on my workstation (Access 2003 and Win XP Home edition) it is also OK, but if I run it on client's workstation (Access 2002, Win XP Professional) it throws me that error.
I runed it several times in debug mode and the wd object is always well created and it is the same object as used in the old version (that works fine). Besides that I cheked VBA references and all are exactly the same as the file version that works. I think that this should be a configuration problem but I still can not find it...
Can anyone help me on that? I spent almost one week searching for the solution and I'm still lost...
Thanks in advance.