padelisle
padelisle

Reputation: 31

How to upgrade a 2007 Excel Workbook application from .xls to .xlsx?

We have an Excel application that I need to maintain that has shown his limitation of 65536 lines maximum in a sheet. I want to upgrade this application to an xml worksheet (.xlsx) to boost this limitation to 1 million. My solution is already targeting .Net 4.0 and using VSTO 4.0.

I tried Tools => Options => Office Tools => Project Upgrade => office 2007 Open XML format but nothing happen.

I tried creating a new Excel 2007 Workbook project and using the existing excel file (.xls). It shows an error box that says that the workbook contains activeX controls.

Upvotes: 0

Views: 650

Answers (2)

padelisle
padelisle

Reputation: 31

This is what I did. I opened the xls file in the project folder not the one in the bin folder. I deleted the customizations: Prepare -> Property -> Document Property -> Advanced Properties -> Personalisation and I deleted the 2 properties _AssemblyLocation and _AssemblyName. I converted the xls file to open xml (.xlsx) like Kiru wrote. I saved the file. Then I opened the solution in Visual Studio and I changed the name of the .xls file to .xlsx. I ran the solution and everything's fine! Visual Studio will add the customizations (custom-code) to the file and put it in the bin folder.

If you don't remove the customization first, it will show an error when you try to build that the file is already customized. If you convert the file to .xlsx and says the file need to be repaired click ok. There might be some change to make to the code like me, I had to remove a reference that didn't exist to System.Linq.

Upvotes: 1

Kiru
Kiru

Reputation: 3565

Can you use Convert in the backstage of the Excel (.xls) and then add it back as existing file. If you have macros in it then save it to macro enabled .xlsm

Upvotes: 0

Related Questions