I have a macro which prints budget reports. It had worked for the past 3 years. Since yesterday, it doesn't work anymore. The macro has not been modified or changed. The macro is run within Accpac.
The error is an Accpac pop up window. The title of the window is Accpac. The msg says: "Automation error. The specified module could not be found."
When I run it step by step, it goes into the "On Error GoTo ACCPACErrorHandler" section right away.
Any solutions?
Thanks.
Here is some of the code:
-------------------------------------------
Sub MainSub()
On Error GoTo ACCPACErrorHandler
Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
Dim mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkSysRW = OpenDBLink(DBLINK_SYSTEM, DBLINK_FLG_READWRITE)
.
.
.
ACCPACErrorHandler:
Dim lCount As Long
Dim lIndex As Long
If Errors Is Nothing Then
MsgBox Err.Description
MsgBox "VBA Macros cannot run where Accpac is deployed as a Web Server"
Else
lCount = Errors.Count
If lCount = 0 Then
MsgBox Err.Description
Else
For lIndex = 0 To lCount - 1
MsgBox Errors.Item(lIndex)
Next
Errors.Clear
End If
Resume Next
End If
End Sub
--------------------------------------------
The error is an Accpac pop up window. The title of the window is Accpac. The msg says: "Automation error. The specified module could not be found."
When I run it step by step, it goes into the "On Error GoTo ACCPACErrorHandler" section right away.
Any solutions?
Thanks.
Here is some of the code:
-------------------------------------------
Sub MainSub()
On Error GoTo ACCPACErrorHandler
Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
Dim mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkSysRW = OpenDBLink(DBLINK_SYSTEM, DBLINK_FLG_READWRITE)
.
.
.
ACCPACErrorHandler:
Dim lCount As Long
Dim lIndex As Long
If Errors Is Nothing Then
MsgBox Err.Description
MsgBox "VBA Macros cannot run where Accpac is deployed as a Web Server"
Else
lCount = Errors.Count
If lCount = 0 Then
MsgBox Err.Description
Else
For lIndex = 0 To lCount - 1
MsgBox Errors.Item(lIndex)
Next
Errors.Clear
End If
Resume Next
End If
End Sub
--------------------------------------------