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
• 12,240 points
12 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
• 20,880 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
• 18,960 points
337 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
• 18,960 points
47 views
0 votes
1 answer

open link of google play store in mobile version android

You can use Android Intents library for opening your ...READ MORE

answered Jun 9 in Others by nisha
• 2,180 points
108 views
0 votes
1 answer

Converting all tabs of excel sheet to PDF

Using VBA, try it like this, for ...READ MORE

answered Sep 26 in Others by narikkadan
• 20,880 points
20 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
524 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
3,936 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,330 points
440 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
• 18,960 points
150 views
0 votes
1 answer

What are the RGB and HEX codes of the 3 color conditional format in Excel?

In Excel 2016 at least the colors ...READ MORE

answered Sep 24 in Others by narikkadan
• 20,880 points
19 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