Worksheets within one Workbook

B

bawahoo

What I am trying to do is run a macro that will take a dat file, then d
the MOD and save into excel. Then take another dat file do the same MO
and save it in another worksheet within the same workbook file. So
guess my gold is to try to save many worksheets within one workbook
Thanks for your help.
====

Set MonarchObj = CreateObject("Monarch32")

With MonarchObj

openfile = .SetReportFile("D:\Cash and Adj Report\cash0902.dat"
False)
If openfile = True Then
openmod = .SetModelFile("D:\Cash and Adj Report\Cash_Adj_Rpt.mod")
If openmod = True Then
.CurrentFilter = "Cash01"
.ExportTable ("D:\Cash and Adj Report\Cash_Adj_Rpt_09.xls")
Workbooks.Open Filename:="D:\Cash and Adj Report\Cash_Adj_Rpt_09.xls"
Sheets(1).Copy Before:=Workbooks("Book1").Sheets(1)
End If
End If

openfile = .SetReportFile("D:\Cash and Adj Report\cash0903.dat"
False)
If openfile = True Then
openmod = .SetModelFile("D:\Cash and Adj Report\Cash_Adj_Rpt.mod")
If openmod = True Then
.CurrentFilter = "Cash02"
.ExportTable ("D:\Cash and Adj Report\Cash_Adj_Rpt_09.xls")
Workbooks.Open Filename:="D:\Cash and Adj Report\Cash_Adj_Rpt_09.xls"
Sheets(1).Copy Before:=Workbooks("Book1").Sheets(1)
End If
End If

.CloseAllDocuments
.Exit

End With
Application.Quit

End Su
 
Top