Skip to content

Instantly share code, notes, and snippets.

View AsposeCellsBlog's full-sized avatar

AsposeCellsBlog AsposeCellsBlog

  • http://products.aspose.com/cells/
View GitHub Profile
@AsposeCellsBlog
AsposeCellsBlog / Center_Align_Excel_Cell.cs
Created December 14, 2018 16:46
Center Align Excel Cell - C#
// Create empty Workbook object.
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();
// Access first worksheet.
Worksheet ws = wb.Worksheets[0];
// Access cell C4 and add some text inside it.
Cell c4 = ws.Cells["C4"];
c4.PutValue("Aspose File Format APIs");
@AsposeCellsBlog
AsposeCellsBlog / Format_Excel_Cell_Numbers_to_Currency.cpp
Created November 25, 2018 07:58
Format Excel Cell Numbers to Currency - C++
// Path of input XLS and output XLSX files.
intrusive_ptr<Aspose::Cells::System::String> inputXLSXFile = new Aspose::Cells::System::String("D:/Download/SampleFormatExcelCellNumbersToCurrency.xlsx");
intrusive_ptr<Aspose::Cells::System::String> outputXLSXFile = new Aspose::Cells::System::String("D:/Download/OutputFormatExcelCellNumbersToCurrency.xlsx");
// Load the input Excel file inside workbook object.
intrusive_ptr<Aspose::Cells::IWorkbook> wb = Aspose::Cells::Factory::CreateIWorkbook(inputXLSXFile);
// Access first worksheet.
intrusive_ptr<Aspose::Cells::IWorksheet> ws = wb->GetIWorksheets()->GetObjectByIndex(0);
@AsposeCellsBlog
AsposeCellsBlog / Format_Excel_Cell_Numbers_to_Currency.java
Created November 23, 2018 17:37
Format Excel Cell Numbers to Currency - Java
// Directory path for input and output Excel files.
String dirPath = "D:/Download/";
// Load the input Excel file inside workbook object.
com.aspose.cells.Workbook wb = new Workbook(dirPath + "SampleFormatExcelCellNumbersToCurrency.xlsx");
// Access first worksheet.
Worksheet ws = wb.getWorksheets().get(0);
// Format Cell G3 with Curreny > Dollar.
@AsposeCellsBlog
AsposeCellsBlog / Format_Excel_Cell_Numbers_to_Currency.cs
Created November 23, 2018 16:41
Format Excel Cell Numbers to Currency - C#.NET
// Directory path for input and output Excel files.
string dirPath = "D:/Download/";
// Load the input Excel file inside workbook object.
Aspose.Cells.Workbook wb = new Workbook(dirPath + "SampleFormatExcelCellNumbersToCurrency.xlsx");
// Access first worksheet.
Worksheet ws = wb.Worksheets[0];
// Format Cell G3 with Curreny > Dollar.
@AsposeCellsBlog
AsposeCellsBlog / Convert_CSV_to_XLSB_format.cpp
Created November 22, 2018 16:37
Convert CSV to XLSB format - C++
// Path of input CSV file and output XLSB files.
intrusive_ptr<Aspose::Cells::System::String> inputCSV = new Aspose::Cells::System::String("D:\\Download\\sampleConvertCSVToExcelFormats.csv");
intrusive_ptr<Aspose::Cells::System::String> outputXLSB = new Aspose::Cells::System::String("D:\\Download\\outputConvertCSVToExcelFormats.xlsb");
// Load your sample CSV file inside the Workbook object.
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(inputCSV);
// Save CSV file to XLSB format.
workbook->Save(outputXLSB, Aspose::Cells::SaveFormat::SaveFormat_Xlsb);
@AsposeCellsBlog
AsposeCellsBlog / Convert_CSV_to_XLSM_format.cpp
Created November 22, 2018 16:35
Convert CSV to XLSM format - C++
// Path of input CSV file and output XLSM files.
intrusive_ptr<Aspose::Cells::System::String> inputCSV = new Aspose::Cells::System::String("D:\\Download\\sampleConvertCSVToExcelFormats.csv");
intrusive_ptr<Aspose::Cells::System::String> outputXLSM = new Aspose::Cells::System::String("D:\\Download\\outputConvertCSVToExcelFormats.xlsm");
// Load your sample CSV file inside the Workbook object.
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(inputCSV);
// Save CSV file to XLSM format.
workbook->Save(outputXLSM, Aspose::Cells::SaveFormat::SaveFormat_Xlsm);
@AsposeCellsBlog
AsposeCellsBlog / Convert_CSV_to_XLSX_format.cpp
Created November 22, 2018 16:34
Convert CSV to XLSX format - C++
// Path of input CSV file and output XLS files.
intrusive_ptr<Aspose::Cells::System::String> inputCSV = new Aspose::Cells::System::String("D:\\Download\\sampleConvertCSVToExcelFormats.csv");
intrusive_ptr<Aspose::Cells::System::String> outputXLSX = new Aspose::Cells::System::String("D:\\Download\\outputConvertCSVToExcelFormats.xlsx");
// Load your sample CSV file inside the Workbook object.
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(inputCSV);
// Save CSV file to XLSX format.
workbook->Save(outputXLSX, Aspose::Cells::SaveFormat::SaveFormat_Xlsx);
@AsposeCellsBlog
AsposeCellsBlog / Convert_CSV_to_XLS_format.cpp
Created November 22, 2018 16:33
Convert CSV to XLS format - C++
// Path of input CSV file and output XLS files.
intrusive_ptr<Aspose::Cells::System::String> inputCSV = new Aspose::Cells::System::String("D:\\Download\\sampleConvertCSVToExcelFormats.csv");
intrusive_ptr<Aspose::Cells::System::String> outputXLS = new Aspose::Cells::System::String("D:\\Download\\outputConvertCSVToExcelFormats.xls");
// Load your sample CSV file inside the Workbook object.
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(inputCSV);
// Save CSV file to XLS format.
workbook->Save(outputXLS, Aspose::Cells::SaveFormat::SaveFormat_Excel97To2003);
@AsposeCellsBlog
AsposeCellsBlog / Convert_CSV_to_XLSB_format.java
Created November 22, 2018 16:25
Convert CSV to XLSB format - Java
// Directory path for input and output files.
String dirPath = "D:\\Download\\";
// Load your sample CSV file inside the Workbook object.
com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook(dirPath + "sampleConvertCSVToExcelFormats.csv");
// Save CSV file to XLSB format.
wb.save(dirPath + "outputConvertCSVToExcelFormats.xlsb", SaveFormat.XLSB);
@AsposeCellsBlog
AsposeCellsBlog / Convert_CSV_to_XLSM_format.java
Created November 22, 2018 16:22
Convert CSV to XLSM format - Java
// Directory path for input and output files.
String dirPath = "D:\\Download\\";
// Load your sample CSV file inside the Workbook object.
com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook(dirPath + "sampleConvertCSVToExcelFormats.csv");
// Save CSV file to XLSM format.
wb.save(dirPath + "outputConvertCSVToExcelFormats.xlsm", SaveFormat.XLSM);