Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Dec 15, 2022 10:15 pm

I’m trying a very simple process – to open an XLSX file and save it as PDF.
My code is as follows:

Code: Select all
USING Spire.Xls.*.

DEFINE VARIABLE oWorkbook           AS Workbook     NO-UNDO.
DEFINE VARIABLE oWorksheet          AS Worksheet    NO-UNDO.

oWorkbook = NEW Workbook().
oWorkbook:LoadFromFile("input.xlsx").
oWorksheet = oWorkbook:worksheets[0].
oWorksheet:SaveToPdf("output.pdf").


When I run this code I get this error:

Could not locate element ‘SaveToPDf’ in class ‘Spire.Xls.Worksheet’.


Any clues please?
Thanks in advance
Jon

JonGilbey
 
Posts: 4
Joined: Thu Dec 15, 2022 3:25 pm

Fri Dec 16, 2022 3:13 am

Hi,

Thanks for your inquiry.
Are you using the latest version of Spire.XLS (Version:10.11.9)? If not, you can download and have a try. If the issue still exists after updating, please provide us with the following information to help us do further investigation. You can send to us via email (support@e-iceblue.com) or attach them here. Thanks for your assistance in advance.
1) your test xlsx file.
2) your test environment, such as OS info (Windows 10 64bit) and region setting (China, Chinese).
3) your application type, such as Console App, .NET Framework 4.8.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 999
Joined: Tue Nov 15, 2022 3:59 am

Fri Dec 16, 2022 1:01 pm

Hi
I downloaded spire.xls-se_12.8.zip - which I assumed was the latest version?
I have attached my sample input file.

My OS: Windows 11 Pro (64 bit)
Region: United Kingdom
Application Type: .NET Framework 4.6

Hoping you can help,
Thanks
Jon
Attachments
input.zip
sample input file
(6.24 KiB) Downloaded 149 times

JonGilbey
 
Posts: 4
Joined: Thu Dec 15, 2022 3:25 pm

Fri Dec 16, 2022 3:31 pm

Just as an addendum to this - I'm now trying 12.7 - the free version - again this is our evaluation stage.
I'm getting the package via here:
download-excel-for-net-free.html

JonGilbey
 
Posts: 4
Joined: Thu Dec 15, 2022 3:25 pm

Fri Dec 16, 2022 3:46 pm

That errored much earlier - it failed to load the DLL which means it didn't recognise the datatype of the workbook.

JonGilbey
 
Posts: 4
Joined: Thu Dec 15, 2022 3:25 pm

Mon Dec 19, 2022 8:41 am

Hi,

Thanks for your feedback.
Kindly note that our Spire.XLS for .NET Standard Edition doesn't support print and conversion function. According to your requirement, you need to use Pro Edition or Pack Edition, please download and test Spire.XLS Pack(Hotfix) Version:12.11.3(https://www.e-iceblue.com/Download/download-excel-for-net-now.html). If you have any issues, please feel free to contact us.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 999
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.XLS