I already found the example here on how to open a csv file into a new excel workbook. I did all the formatting I needed and now I need to add(import) another csv file into the same excel workbook, but on a different (new) sheet. I can't figure out how to do it.
Here is the code I found here for the first worksheet. It works.
set ExcelObject to new type Microsoft.Office.Interop.Excel.Application
set ExcelObject::Visible to true
set WorkBooksCollection to ExcelObject::Workbooks
*> Open File
set Workbook to WorkBooksCollection::Open(
WS-CSVFILE,
type Type::Missing,
type Type::Missing,
2,
type Type::Missing,
type Type::Missing,
type Type::Missing,
type Type::Missing,
",",
type Type::Missing,
type Type::Missing,
type Type::Missing,
type Type::Missing,
type Type::Missing,
type Type::Missing)
set Worksheets to Workbook::Worksheets
set Worksheet to Worksheets[ws-wkst-name] as type _Worksheet.
*> (did all my formatting here)
*> save
invoke WorkSheet::SaveAs(WS-XLSFILE, type XlFileFormat::xlExcel7 , type Type::Missing, type Type::Missing, type Type::Missing
type Type::Missing, type Type::Missing, type Type::Missing, type Type::Missing, type Type::Missing)
Thank You!




