Is the process of converting xlsm to PDF the same as converting xlsm to xlsx and then to PDF?
The process of converting an XLSM file to PDF is not the same as converting it to XLSX first and then to PDF. Aspose.PDF does not support direct conversion from Excel files (including XLSM) to PDF. Instead, you should use Aspose.Cells, which is specifically designed for handling Excel files and can convert XLSM files directly to PDF.
To convert an XLSM file to PDF using Aspose.Cells, you can follow these steps:
- Load the XLSM file using the
Workbook
class from Aspose.Cells. - Use the
Save
method to save the workbook in PDF format.
Here is a simple code example:
// Load the XLSM file
var workbook = new Aspose.Cells.Workbook("input.xlsm");
// Save the workbook as PDF
workbook.Save("output.pdf", Aspose.Cells.SaveFormat.Pdf);
This approach allows you to convert the XLSM file directly to PDF without the need to convert it to XLSX first. For more detailed information, you can refer to the Aspose.Cells documentation on converting Excel to PDF here.
If you have any further questions or need assistance with specific code, feel free to ask!