Awol40
September 12th, 2008, 07:01 AM
Could anyone tell me how to export an additional filter named "Non On Acct" in the below code.
I have two filters and one summary to export. This deals with one of each but I need the other filter to appear as a seperate tab in Excel.
Any help appreciated
'Launch Monarch
'
Dim MonarchObj As Object
Dim openfile As Boolean
Dim openmod As Boolean
Dim t As Boolean
Dim exptable As Boolean
Dim expsum As Boolean
'
Set MonarchObj = GetObject("", "Monarch32")
If MonarchObj Is Nothing Then
Set MonarchObj = CreateObject("Monarch32")
End If
MonarchObj.Visible True
' MonarchObj.Visible = False
t = MonarchObj.SetLogFile("C:\Temp\Monarch\LogFile.log", False)
File_Name = PRN_Dir & User_Name & "_Income Print.prn"
openfile = MonarchObj.SetReportFile(File_Name, False)
If openfile = True Then
File_Name = Model_Dir & "PRN PMA Trans Listing - Income.xmod"
openmod = MonarchObj.SetModelFile(File_Name)
If openmod = True Then
MonarchObj.CurrentFilter = "Service Charge On Account"
MonarchObj.CurrentSort = "On Acct Debtor Totals"
File_Name = Export_Dir & User_Name & "_PMA Income file.xls"
exptable = MonarchObj.JetExportTable(File_Name, "On Account Detail", 0)
expsum = MonarchObj.JetExportSummary(File_Name, "On Account Totals", 0)
End If
End If
MonarchObj.CloseAllDocuments
MonarchObj.Exit
Workbooks.Open Filename:= _
File_Name _
, Editable:=True
End Sub
I have two filters and one summary to export. This deals with one of each but I need the other filter to appear as a seperate tab in Excel.
Any help appreciated
'Launch Monarch
'
Dim MonarchObj As Object
Dim openfile As Boolean
Dim openmod As Boolean
Dim t As Boolean
Dim exptable As Boolean
Dim expsum As Boolean
'
Set MonarchObj = GetObject("", "Monarch32")
If MonarchObj Is Nothing Then
Set MonarchObj = CreateObject("Monarch32")
End If
MonarchObj.Visible True
' MonarchObj.Visible = False
t = MonarchObj.SetLogFile("C:\Temp\Monarch\LogFile.log", False)
File_Name = PRN_Dir & User_Name & "_Income Print.prn"
openfile = MonarchObj.SetReportFile(File_Name, False)
If openfile = True Then
File_Name = Model_Dir & "PRN PMA Trans Listing - Income.xmod"
openmod = MonarchObj.SetModelFile(File_Name)
If openmod = True Then
MonarchObj.CurrentFilter = "Service Charge On Account"
MonarchObj.CurrentSort = "On Acct Debtor Totals"
File_Name = Export_Dir & User_Name & "_PMA Income file.xls"
exptable = MonarchObj.JetExportTable(File_Name, "On Account Detail", 0)
expsum = MonarchObj.JetExportSummary(File_Name, "On Account Totals", 0)
End If
End If
MonarchObj.CloseAllDocuments
MonarchObj.Exit
Workbooks.Open Filename:= _
File_Name _
, Editable:=True
End Sub