Spire.XLS.Cpp Version 13.6.1
How do I get multiple worksheets from my input XLS file and maintain their worksheet names before converting to a CSV?
This is my code so far:
#include "Spire.Xls.o.h";
using namespace Spire::Xls;
int main()
{
//Initialize an instance of the Workbook class
Workbook* workbook = new Workbook();
//Load an Excel file
workbook->LoadFromFile(L"filename");
//Get the first worksheet
intrusive_ptr<Worksheet> sheet = dynamic_pointer_cast<Worksheet>(workbook->GetWorksheets()->Get(0));
//Delete the first row from the Spreashsheet database as the text is wrapped and it gets messed up when converted to CSV
sheet->DeleteRow(1);
//Save the worksheet to a CSV file
sheet->SaveToFile(L"ExcelToCsv.csv", L",", Encoding::GetUTF8());
workbook->Dispose();
delete workbook;
}
Thank you,
Daynah