vellakaran
Programmer
Here is the code that is causing the error:
Function OpenMicrosoftWord(objfrm_MSWord As BoundObjectFrame, obj_MSWord As Object, Optional DoOpen As Boolean = False) As Boolean
'This function opens Microsoft Word. This function requires a bound obect frame that
' contains microsoft word documents or templates.
On Error GoTo Errorhandler
Dim obj_MSWordApplication As Object
Dim bol_status As Boolean
bol_status = True
objfrm_MSWord.Verb = acOLEVerbOpen 'Tells MS Access to open the application
objfrm_MSWord.Action = acOLEActivate ' Activates the application
Set obj_MSWordApplication = objfrm_MSWord.Object.Application
If DoOpen Then
obj_MSWordApplication.Run Macroname:="MyOpen"
End If
Set obj_MSWord = obj_MSWordApplication.ActiveDocument
OpenMicrosoftWord = bol_status
Exit Function
Errorhandler:
If (Err <> 4633) And (Err <> -2147352573) Then
OpenMicrosoftWord = False
Select Case Err
Dim varRetVal As Variant
Case -2147220995
OpenMicrosoftWord = True
Resume Next
Case Else: varRetVal = ErrorMsg("OpenMicrosoftWord", Err, Error)
End Select
Else
Set obj_MSWord = obj_MSWordApplication.ActiveDocument
OpenMicrosoftWord = bol_status
End If
End Function
I added the code to trap the error -2147220995. Now it appears other things are going wrong. The app will shut down (and pop-up the Do you want to send this error message to Microsoft messagebox..) when a user opens a new document which causes the above code to be run.
The -2147220995 error was not occurring all the time nor to everyone (300+ users). When it did happen, none of the data would be lost from the Word document they were working on. So I thought I would just trap it and suppress the message, but now there seems to be other issues.
Also a user just notified me that she got a, "Expression too complex Error 16" error in the above Function.
Anybody have any ideas what is going on, or why I would get the -214722095 error in the first place. The above code was written in Access 97 and we recently went to Access 2002. We are using XP the Professional Edition.
I also dont know exactly where it is happening in the code, because I have been unable to repplicate on my machine, that is why I decided just to trap it.
Thanks for any help and sorry for the long post!
EC
Function OpenMicrosoftWord(objfrm_MSWord As BoundObjectFrame, obj_MSWord As Object, Optional DoOpen As Boolean = False) As Boolean
'This function opens Microsoft Word. This function requires a bound obect frame that
' contains microsoft word documents or templates.
On Error GoTo Errorhandler
Dim obj_MSWordApplication As Object
Dim bol_status As Boolean
bol_status = True
objfrm_MSWord.Verb = acOLEVerbOpen 'Tells MS Access to open the application
objfrm_MSWord.Action = acOLEActivate ' Activates the application
Set obj_MSWordApplication = objfrm_MSWord.Object.Application
If DoOpen Then
obj_MSWordApplication.Run Macroname:="MyOpen"
End If
Set obj_MSWord = obj_MSWordApplication.ActiveDocument
OpenMicrosoftWord = bol_status
Exit Function
Errorhandler:
If (Err <> 4633) And (Err <> -2147352573) Then
OpenMicrosoftWord = False
Select Case Err
Dim varRetVal As Variant
Case -2147220995
OpenMicrosoftWord = True
Resume Next
Case Else: varRetVal = ErrorMsg("OpenMicrosoftWord", Err, Error)
End Select
Else
Set obj_MSWord = obj_MSWordApplication.ActiveDocument
OpenMicrosoftWord = bol_status
End If
End Function
I added the code to trap the error -2147220995. Now it appears other things are going wrong. The app will shut down (and pop-up the Do you want to send this error message to Microsoft messagebox..) when a user opens a new document which causes the above code to be run.
The -2147220995 error was not occurring all the time nor to everyone (300+ users). When it did happen, none of the data would be lost from the Word document they were working on. So I thought I would just trap it and suppress the message, but now there seems to be other issues.
Also a user just notified me that she got a, "Expression too complex Error 16" error in the above Function.
Anybody have any ideas what is going on, or why I would get the -214722095 error in the first place. The above code was written in Access 97 and we recently went to Access 2002. We are using XP the Professional Edition.
I also dont know exactly where it is happening in the code, because I have been unable to repplicate on my machine, that is why I decided just to trap it.
Thanks for any help and sorry for the long post!
EC