I am trying to utilize Monarch to export spreadsheets through VBA. I get an ActiveX error. I looked through the existing topics and found one that was similar (VBA app bombs) but I did not see resolution on it. So I need some help please. This is the code I have, below. I also removed the ActiveX references in VBA.
Option Compare Database
'EXPORT SPOOLER REPORT TO SPREADSHEET VIA MONARCH
'On Error GoTo Error_Handler
Dim MonarchObj As Object
'original...Dim openfile, openmod, t As Boolean
Dim openfile As Variant
Dim openmod As Variant
Dim t As Boolean
'If Monarch is currently active GetObject will use Monarch. If it is not use the
'CreateObject() to open another copy of Monarch.
On Error Resume Next
Set MonarchObj = GetObject("C:Program FilesMonarchProgrammonarch.tlb")
'Set MonarchObj = GetObject("", "Monarch32")
If MonarchObj Is Nothing Then
Set MonarchObj = CreateObject("Monarch32")
t = MonarchObj.SetLogFile("C:Documents and Settings" & ClipNull(GetUser()) & "My DocumentsMPrg_G5.log", False)
openfile = MonarchObj.SetReportFile("azservb01RIMS_DOWNLDsp" & _
Forms![frmLogin]![txtSP] & ".txt", False)
If openfile = True Then
openmod = MonarchObj.SetModelFile("azservb01DPT_ENRCOMEDIRIMS EDI JOBS" & _
If openmod = True Then
MonarchObj.JetExportTable ("C:Documents and Settings" & ClipNull(GetUser()) & "My Documentssp" & Forms![frmLogin]![txtSP] & ".xls")
MsgBox "Spreadsheet not created"