What Version of Excel Produces this Message and how do I query for it?

complete

Active member
Joined
Oct 24, 2012
Messages
31
Programming Experience
3-5
I have some C# code that opens and writes to XLS files and CSV files. During the process of writing to the XLS files workpages and workbook, etc., I get this message on my computer where I am doing development.

Excel-Message.jpg


Now, here is where it gets interesting. This does not happen on my boss' computer when I give him the Release executable of my program. So, on my machine, there must be some sort of version of Excel I have locally that is more advanced (or less advanced). I am able to still do development by using the handy "#if DEBUG" condition where I minimize the window to allow the user to click on the Continue button in the pop up displayed here above.



#if DEBUG

this.WindowState = FormWindowState.Minimized;

wb2.Save();

this.WindowState = FormWindowState.Normal;

#endif

#if !DEBUG

wb2.Save();

#endif



But it would be best to change this code to something where I am able to do a query on the system and get the version of Excel installed and then handle this appropriately.
 
Moved out of C# General Discussion and into the "Components and Controls...Suites" area.
 
Anyway, if you simply save to .XLSX that you'll get full fidelity.

With .XLS you only get support for whatever features were availalble is Office 97 through Office 2003.

With .CSV all you'll get is just data storage. You don't get any formatting or formulas.
 
During the process of writing to the XLS files workpages and workbook, etc., I get this message
Why not use standard xlsx format since Excel 2007? There should be no need to support Excel 97-2003. Even Excel 2007-2013 apps has reached end of extended support now.
 
Back
Top Bottom