"运行时错误'' - 2147023067(80070725)'':自动化错误。 TC < [email protected]>写在消息新闻:1067480554.540605@teuthos ... *什么*自动化错误? TC " Neil Ginsberg" < nr*@nrgconsult.com>在消息中写道新闻:5t ***************** @ newsread3.news.pas.earthl ink.net ... I我的Access 2000数据库有一个奇怪的情况。我的代码在 数据库已经运行了多年,现在突然在一两个上工作不正常我客户的机器。代码通过自动化打开MS Word ,然后打开一个特定的Word文档。在大多数机器上工作仍然 但是在其中的一个或两个上,用户正在获得自动化错误。使用的代码如下: Dim objWord As Word.Application 设置objWord = New Word.Application objWord.Documents.Open FileName:= strFilename,_ ConfirmConversions:= False,_ ReadOnly:= False,_ AddToRecentFiles:= False,_ Revert:= False,_ 格式:= gcon_wdOpenFormatAuto''这是全局的常量与 Word常量值 自动化错误发生在第三行,当试图打开文档时(文档确实存在,所以'不是问题'这个问题'只发生在两个 的几十台机器上,这个问题比以下更令人陌生。我有一个数据库的精简副本,用户可以随身携带并显示给 客户端。减少数据库版本(称之为App B)取自原始的(称之为App A),其中删除了一些功能。关于上面的代码 那个'blockquote class =post_quotes>失败了,App A和App B都是相同的,两者都有相同的引用。 现在,这是一个非常奇怪的部分。 在一台有问题的计算机上,App A在上面的代码中失败了。 在另一台遇到问题的计算机上,App A在上面的代码中工作正常,但App B在该代码中失败了。所以,在第二种情况下,使用相同的计算机和两组完全相同的代码,一组失败,另一组没有。我看过备份副本到看看它是否是一个腐败问题,并没有看到任何差异。并且,如上所述,此代码已经到位 年没有问题,直到前几天这些问题 开始正在发生。 所有用户都在他们的C盘上安装了MS Office和数据库应用程序。 任何帮助都将是感谢。 谢谢! Neil I have a strange situation with my Access 2000 database. I have code in thedatabase which has worked fine for years, and now all of a sudden doesn''twork fine on one or two of my client''s machines. The code opens MS Wordthrough Automation and then opens a particular Word doc. It''s still workingfine on most machines; but on one or two of them, the user is getting anAutomation Error. The code used is as follows:Dim objWord As Word.ApplicationSet objWord = New Word.ApplicationobjWord.Documents.Open FileName:=strFilename, _ConfirmConversions:=False, _ReadOnly:=False, _AddToRecentFiles:=False, _Revert:=False, _Format:=gcon_wdOpenFormatAuto ''this is global constant withWord constant valueThe Automation Error occurs on the third line, when trying to open thedocument (the document does exist, so that''s not the problem).Even stranger than the fact that the problem''s only happening on two out ofseveral dozen machines, is the following. I have a pared-down copy of thedatabase, that users use to take on the road with them and show to clients.The pared-down version (call it "App B") was taken from the original (callit "App A") with some functionality removed. Regarding the above code that''sfailing, both App A and App B are identical, and both have the samereferences.Now, here''s the really strange part.On one computer that''s having problems, App A fails in the above code. Onthe other computer that''s having problems, App A works fine in the abovecode, but App B fails in that code. So, in the second case, with the samecomputer and two identical sets of code, one set fails, the other doesn''t.I''ve looked at backup copies to see if it was a corruption issue, andhaven''t seen any difference. And, as noted, this code has been in place foryears without problems, until just the other day when these problems startedhappening.All of the users have MS Office and the database application installed ontheir C drives.Any assistance would be appreciated.Thanks!Neil 解决方案 > the user is getting an Automation Error.NeilI don''t know if this might help pinpoint the problem.Have you written an error handler to display theautomation error using the vbObjectError constant?If you need it, the following information relates to thevbObjectError constant:1. Subtracting vbObjectError from Err.Number willindicate the error as defined by the server application.2. However, if subtracting vbObjectError from Err.Numberresults in a number outside the range 0 - 65535, theerror is a VBA error.Therefore, your error handler might look like:'' Remove the constant added by the server application:MyError = Err.Number - vbObjectError'' Is the result in the range 0 - 65535?If MyError > 0 and MyError < 65535 thenMsg = "The object you accessed assigned this number to " & _"the error: " & MyError & ". The originator of " & _"the error was: " & Err.Source & ". Press F1 to " & _"see the originating applications'' help topic."Else '' It''s a VBA error:Msg = "This error " & Err.Number & " is a VBA error. " & _"Press Help button or F1 for VBA Help topic on " & _"this error."End ifMsgbox Msg, , "Object Error", Err.Helpfile, Err.HelpContextObviously, this doesn''t solve your problem, but it mayhelp you identify it.HTHGeoff*What* automation error?TC"Neil Ginsberg" <nr*@nrgconsult.com> wrote in messagenews:5t*****************@newsread3.news.pas.earthl ink.net... I have a strange situation with my Access 2000 database. I have code inthe database which has worked fine for years, and now all of a sudden doesn''t work fine on one or two of my client''s machines. The code opens MS Word through Automation and then opens a particular Word doc. It''s stillworking fine on most machines; but on one or two of them, the user is getting an Automation Error. The code used is as follows: Dim objWord As Word.Application Set objWord = New Word.Application objWord.Documents.Open FileName:=strFilename, _ ConfirmConversions:=False, _ ReadOnly:=False, _ AddToRecentFiles:=False, _ Revert:=False, _ Format:=gcon_wdOpenFormatAuto ''this is global constant with Word constant value The Automation Error occurs on the third line, when trying to open the document (the document does exist, so that''s not the problem). Even stranger than the fact that the problem''s only happening on two outof several dozen machines, is the following. I have a pared-down copy of the database, that users use to take on the road with them and show toclients. The pared-down version (call it "App B") was taken from the original (call it "App A") with some functionality removed. Regarding the above codethat''s failing, both App A and App B are identical, and both have the same references. Now, here''s the really strange part. On one computer that''s having problems, App A fails in the above code. On the other computer that''s having problems, App A works fine in the above code, but App B fails in that code. So, in the second case, with the same computer and two identical sets of code, one set fails, the other doesn''t. I''ve looked at backup copies to see if it was a corruption issue, and haven''t seen any difference. And, as noted, this code has been in placefor years without problems, until just the other day when these problemsstarted happening. All of the users have MS Office and the database application installed on their C drives. Any assistance would be appreciated. Thanks! Neil"Run-time error ''-2147023067 (80070725)'': Automation error.""TC" <[email protected]> wrote in message news:1067480554.540605@teuthos... *What* automation error? TC "Neil Ginsberg" <nr*@nrgconsult.com> wrote in message news:5t*****************@newsread3.news.pas.earthl ink.net... I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a suddendoesn''t work fine on one or two of my client''s machines. The code opens MS Word through Automation and then opens a particular Word doc. It''s still working fine on most machines; but on one or two of them, the user is getting an Automation Error. The code used is as follows: Dim objWord As Word.Application Set objWord = New Word.Application objWord.Documents.Open FileName:=strFilename, _ ConfirmConversions:=False, _ ReadOnly:=False, _ AddToRecentFiles:=False, _ Revert:=False, _ Format:=gcon_wdOpenFormatAuto ''this is global constant with Word constant value The Automation Error occurs on the third line, when trying to open the document (the document does exist, so that''s not the problem). Even stranger than the fact that the problem''s only happening on two out of several dozen machines, is the following. I have a pared-down copy ofthe database, that users use to take on the road with them and show to clients. The pared-down version (call it "App B") was taken from the original(call it "App A") with some functionality removed. Regarding the above code that''s failing, both App A and App B are identical, and both have the same references. Now, here''s the really strange part. On one computer that''s having problems, App A fails in the above code.On the other computer that''s having problems, App A works fine in the above code, but App B fails in that code. So, in the second case, with thesame computer and two identical sets of code, one set fails, the otherdoesn''t. I''ve looked at backup copies to see if it was a corruption issue, and haven''t seen any difference. And, as noted, this code has been in place for years without problems, until just the other day when these problems started happening. All of the users have MS Office and the database application installedon their C drives. Any assistance would be appreciated. Thanks! Neil 这篇关于奇怪的自动化问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-13 14:46