Title: Script For Monarch Application
Morris,
 
Here is a parameter driven sub that I use on a daily basis with Monarch:
 
Sub MonarchAuto(strLogFile As String, strRptFile As String, strMdlFile As String, Optional strFilter As String _
, Optional strSummary As String, Optional strSheetName As String, Optional strExportFile As String)
    Dim Mo As Object
    Dim ExportFile As Integer
    Dim openfile As Boolean
    Dim openmod As Boolean
    Dim t As Boolean
 
    Set Mo = GetObject("", "Monarch32")
    If Mo Is Nothing Then
        Set Mo = CreateObject("Monarch32")
    End If
 

    t = Mo.SetLogFile(strLogFile, True)
    openfile = Mo.SetReportFile(strRptFile, False)
    If openfile = True Then
        openmod = Mo.SetModelFile(strMdlFile)
        If openmod = True Then
            Mo.CurrentFilter = strFilter
            Mo.CurrentSummary = strSummary
            If strSummary <> "" Then
                ExportFile = Mo.JetExportSummary(strExportFile, strSheetName, 0)
            Else
                ExportFile = Mo.JetExportTable(strExportFile, strSheetName, 2)
            End If
        End If
    End If
    Mo.CloseAllDocuments
    Mo.Exit
    Set Mo = Nothing
End Sub
Call this sub using literals as parameters, or create variables and pass these as parameters:
Example:
MonarchAuto "Logfile.txt","ReportFile.txt","MdlFile.mod","Filter","Summary","SpreadSheetName or table Name","ExportFileName"
 
Let me know if you have any questions.
 
 
 
Thanks,
 
Dwight Clevenger
Senior System Analyst
Baptist Health System
615 Soledad
San Antonio, TX. 78213
210-297-1563
[EMAIL PROTECTED]

>>> [EMAIL PROTECTED] 08/24/2004 01:07:59 PM >>>

I am looking for a script that connects to Monarch and opens up a file and a model. Appreciate any help.

Morris Benjamin
Programmer/Analyst
Daniel Freeman Hospital
310-448-7833


This email and any files transmitted with it may contain information
that is PRIVILEGED AND CONFIDENTIAL. It is the property of the
Baptist Health System and is intended only for the use of the intended
recipient. If you have received this email in error, do not
disseminate, distribute, forward, print or copy this email or any of
its' attachments. Immediately destroy/purge the email and all
attachments and notify the sender by reply of email. Any misuse/abuse
may result in disciplinary action and/or legal liability. Unauthorized
interception of this email is a violation of federal law.

Reply via email to