|
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
|
Title: Script For Monarch Application
- [Talk] Script For Monarch Application Benjamin, Morris
- Dwight Clevenger
