Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
There is no direct option available to create custom paper sizes in MS Excel; however, you can set a custom paper size for your desired worksheets when rendering Excel files to the PDF format. This document explains how to set a custom paper size of a worksheet using Aspose.Cells APIs.
Aspose.Cells allows you to set your desired paper size for the worksheet. You may use the CustomPaperSize method of the PageSetup class to specify a custom page size. The following sample code illustrates how to specify a custom paper size for the first worksheet in the workbook. Please also see the output PDF generated with the following code for reference.

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C
// Create workbook object
Workbook wb;
// Access first worksheet
Worksheet ws = wb.GetWorksheets().Get(0);
// Set custom paper size in unit of inches
ws.GetPageSetup().CustomPaperSize(6, 4);
// Access cell B4
Cell b4 = ws.GetCells().Get("B4");
// Add the message to cell B4
b4.PutValue(u"Pdf Page Dimensions: 6.00 x 4.00 in");
// Save the workbook in PDF format
U16String outputDir(u"..\\Data\\02_OutputDirectory\\");
wb.Save(outputDir + u"outputCustomPaperSize.pdf");
std::cout << "Workbook saved successfully!" << std::endl;
Aspose::Cells::Cleanup();
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.