Free Support Forum -

How to prevent one of the sheets in excel from converting to pdf with C# using Aspose.Cells REST API?


We are using Aspose.Cells.Cloud.SDK to convert excel files to PDF. There is a ‘Help’ sheet in all these excel documents that just contains instructions, which I don’t want to see in the final PDF document. Is there a way I can remove this sheet from converting to PDF?

Any help is greatly appreciated. Thank you in advance.



Please delete the ‘Help’ sheet from the Excel file and convert the Excel file to a PDF file.

Refer to the following code:

string name = “CustomTest_7212.xlsx”;
string needRemovedSheet = “Help”;
CellsApi cellsApi = new CellsApi("your client id ", “your client secret”);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.SaveFormat = “pdf”;
pdfSaveOptions.OnePagePerSheet = true;
Stream stream = Tools.GetFileStream(“Book1.xlsx”);
stream.Seek(0, SeekOrigin.Begin);
cellsApi.UploadFile(name, stream);
cellsApi.CellsWorksheetsDeleteWorksheet(name, needRemovedSheet);
cellsApi.CellsSaveAsPostDocumentSaveAs(name, pdfSaveOptions, “CustomTest_7212.pdf”);

1 Like