0

I want to create a .xls file using OpenXML SDK. I am able to create .xlsx and .xlsm files but when i save it as .xls and open in my system it pops an error. Then I have to do save as again for it to work properly. Is there any way to save files directly in .xls format?

1 Answer 1

1

Simple answer is No, you cannot do it.

The reason being .xls format is proprietary to Microsoft. OpenXml SDK cannot understand or write to that format. If you want to store data in .xls format, then you need to use Microsoft office excel interop objects.

Excel namespace interop

If you indeed want to take the route of adding interops to your application to save to .xls format, I would also suggest you to look into following SO answer because adding reference to interop objects in .NET core is not straight forward.

ms interop in .net core

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.