Program that works in all version of excel

0 votes
A Windows Form application I recently created has a number of datagrids. The data must be exported into Excel for my client. They use various Excel versions, including 2003, 2007, 2010, and 2013, whereas I use Office 2013. I utilized references from Excel 2013

(Object Library for Excel 15.0 from Microsoft)

In my course. My client recently complained that the export option was broken. My research indicates that my application appears to function properly for users of Office 2013 but not for users of earlier Office versions.

What can I do to ensure that my application runs properly in earlier Excel versions?
Sep 23 in Others by Kithuzzz
• 20,660 points
45 views

1 answer to this question.

0 votes

Knowing that all of your users will have Excel allows you to remove the DLL references from your project and convert your Excel references to "Objects" rather than hardcoded Excel objects. As long as you don't use a NEW function that isn't available in the earlier versions, this will work with all versions of Office.

For example, instead of this:

Dim _xlApp As Excel.Application
Dim _xlBook As Excel.Workbook

Try this:

Dim _xlApp As Object 'Excel.Application
Dim _xlBook As Object 'Excel.Workbook

Everything works the same (except no intellisence) except for instantiation of the excel application:

_xlApp = CreateObject("Excel.Application") 'New Excel.Application

I have done it this way for 15 years without ever changing my code based on different versions.

answered Sep 24 by narikkadan
• 37,660 points

Related Questions In Others

0 votes
1 answer

Change date format of cell in excel from dd.mm.yyyy to yyy/mm/dd ( excel version 2013 )

Hello :)   Excel’s Format Cells function can quickly ...READ MORE

answered Feb 9 in Others by gaurav
• 22,040 points
531 views
0 votes
1 answer

How to look in all folders in directory to change file extensions of excel file?

Loop Through All Subfolders Using VBA Dim strCurrentFileExt ...READ MORE

answered Nov 24 in Others by narikkadan
• 37,660 points
25 views
0 votes
1 answer

Generate a flat list of all excel cell formulas

Hello, you'll have to follow certain steps ...READ MORE

answered Feb 18 in Others by gaurav
• 22,040 points
79 views
0 votes
1 answer

Display random images from USB on Raspberry Pi

Hey, it's a cool idea! And, since ...READ MORE

answered Nov 28, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
585 views
+1 vote
1 answer

RegEx to remove XML tags and their content

I presume you want to drop the ...READ MORE

answered Feb 13, 2019 in IoT (Internet of Things) by Shubham
• 13,490 points
4,174 views
0 votes
1 answer

'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine

In order to fix this problem, you ...READ MORE

answered Feb 10 in Others by Soham
• 9,670 points
656 views
0 votes
1 answer

Deleting duplicate rows in Excel using Epplus

You need to re-think this… the while ...READ MORE

answered Feb 23 in Database by gaurav
• 22,040 points
297 views
0 votes
1 answer

How to get sum of all matches of HLOOKUP in Excel?

Consider: =SUMPRODUCT((A1:E1="apple")*(A2:E2)) To include more ...READ MORE

answered Oct 16 in Others by narikkadan
• 37,660 points
77 views
0 votes
1 answer

Excel - Make a graph that shows number of occurrences of each value in a column

There is probably a better way to ...READ MORE

answered Oct 21 in Others by narikkadan
• 37,660 points
77 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP