473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

TransferSpreadsheet, word automation; 'Error 0'

Hello,

When executing DoCmd.TransferSpreadsheet to an .xls file that's being
used as a datasource for a Word mail merge document, if that Word
document is currently open, the TransferSpreadsheet action fails with
an 'Error 0'. I have tried different methods of trapping that error,
and I still cannot get my app to indicate that the user should exit
Word: I have tried disabling the error handler before DoCmd is called,
looking for an Err object after the call, and then using Err.Raise to
generate a custom error:

On Error Resume Next
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
tblName, xlsPath, , "DP_table"
If Err Then
Err.Raise 811, "Document pump", Err.description & vbCrLf &
"(note: Word may have crashed, leaving the file locked; killing the
WINWORD.EXE task may solve this)."
End If
On Error GoTo error_exit

.... but this does not work: still Error 0. If I do not disable the
error handler, DoCmd never reaches the Err.Raise statement, leaving me
with Error 0 again.

I have tried determining whether or not the Word document is open
(using methods of the Word automation objects) but it didn't work for a
non-admin user (which is a problem).

Please note that I am properly exiting my function before the error
handler (most posts on this board regarding Error 0 were due to this).

Does anyone have any suggestions?

Thanking you kindly in advance,
Robert Waters

Sep 27 '06 #1
0 1790

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mickeydisn | last post by:
Sub: C++ Word automation Extract text hello. I want extact text form a word document using a visual c++ programme. I have see a lot of documentation. and my analysis is that I must use a...
1
by: Kent Eilers | last post by:
I'm learning automation basics here with a Access-Word mail merge. Specifically I want to obtain a reference to the Word error object....using Access as an automation client. Is this possible? ...
3
by: Mike MacSween | last post by:
Office 2000 From Access I've been starting an instance of word and doing a mail merge. Everything hunky-dory until I applied SP1 yesterday. Now this: dim wrd as Object set wrd =...
12
by: Cheval | last post by:
Has anyone had any problems with inter-office automation between MS Word and MS Access in Office 2003? I have recently installed office 2003 in a new folder and have left the older office 2000...
0
by: Mick Hardy | last post by:
Hi, Has anyone seen this weird behaviour or have any suggestions or can anyone reproduce it? The history: I converted a large third party DB from 97 to XP and it uses the...
1
by: barma16 | last post by:
I've hit a bit of a brick wall here, and could use some advice. I have an Access application whose output is a four-tab Excel spreadsheet where three of the four tabs are the result of database...
4
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
2
by: AlenaMezh | last post by:
Hello! My Code destroys Excel's normal work.After running this code I acan' open excel file as normal. Do you know why? Please, answer. Public Function import_test_1() Dim objXL As Object Dim...
3
by: Greg (codepug | last post by:
For the purpose of viewing a document that I would like to modify on rare occassion using word. I would like to create a document with MS Word, and then have my Access Application launch and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.