Exception when saving to HTML

I’m having issues when trying to save an excel workbook
as a HMTL file. Saving in other formats such as TSV
and PDF works just fine, but saving as HTML always
results in an exception with the message
“ObjectDisposed_StreamClosed”.

I’m using the C++ version of Aspose.Cells 19.11.0 (eval license).
I’m using the API call:
void IWorkbook::Save(Aspose::Cells::Systems::StringPtr fileName , Aspose::Cells::SaveFormat saveFormat)

example01.zip (11.8 KB)

@patjep,

Thanks for the template file.

We appreciate if you create a sample standalone VS.NET C++ application, zip the project and post us (you may upload to file sharing service (e.g Dropbox, Google drive, etc.) and share the Download link), we will check it soon.

I was actually wrong in assuming the issue only occurred when reading existing files. In fact,
it seems a new, empty workbook results in the very same exception. I’ve attached a small
code example on how to re-create the issue.

xl_example_02.zip (503 Bytes)

@patjep,
Thank you for sharing the sample code. I have tried this scenario here but could not observe any issue as new or existing Excel files (including your sample Excel file) are successfully converted to multiple formats including HTML. This complete sample project is uploaded to dropbox and shared below for your reference. Please download it and share the feedback after testing the scenario again at your end.

HtmlOutput.zip (28.2 KB)

Thank you for your assistance. Your example did indeed work for me, but I was
puzzled as to why. It seems like the issue appears if you do not use an absolute
or relative directory as input to the Save method.

My example works if I save to .\example01.html but fails if I enter example01.html.
Can you reproduce this behavior?

@patjep,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSCPP-234 – Exception raised while saving workbook as HTML without absolute/relative directory path in Save function

@patjep,

For the time being, please add absolute/relative path for the file or run your program on the drive/disk other than C to avoid the exception. We will surely fix this issue in next version (the release is scheduled in the third week of this month).

@Amjad_Sahi

Excellent, thank you!

@patjep,

You are welcome.