1 Reply Latest reply: May 15, 2014 9:52 AM by RalphB _ RSS

    macro with different worksheet name

    JoTran _

      What I am trying to do is run a macro that will take a txt file, then do the MOD and save into excel spreadsheet.  Then take another txt file do the same MOD and save it into the same spreadsheet under a different worksheet name.  I am not sure if my syntax for the worksheet is correct, since it bombs out at that syntax.


      Thanks in advance.


      openfile = .SetReportFile("R:JohnTranCash and Adj Reportcash0902.dat", False)       

              If openfile = True Then

                  openmod = .SetModelFile("R:JohnTranCash and Adj ReportCash_Adj_Rpt.mod")          

                  If openmod = True Then      

                      .CurrentFilter = "GL KEY 113"

                      .ExportTable ("R:JohnTranCash and Adj ReportCash_Adj_Rpt_0902.xls")

                      Workbooks.Open Filename:="R:JohnTranCash and Adj ReportCash_Adj_Rpt_0902.xls"

                   Sheets("cash0902").Copy Before:=Workbooks("Book1").Sheets(1)           

                  End If

                End If

        • macro with different worksheet name
          RalphB _

          If you have Monarch V 6 Pro or newer, you can use the JetExportTable or JetExportSummary command.  With either of these you can add worksheets to an Excel workbook.  Check out the Monarch Programmers Guide in the Support Download site on Datawatch's homepage for complete details.