Connection string not working when saving to 2007 format - interop

I'm very confused with OleDB & Excel.
I've 2 files:
One is saved in Excel 2007
One is saved in Excel 2010
This is because some computers have 2007 and other 2010 version of Microsoft Excel.
In vb.net i use:
m_sConn1 = String.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='{0}';Extended Properties='Excel 12.0;HDR=NO;IMEX=1';", file)
When is do:
conn1 = New System.Data.OleDb.OleDbConnection(m_sConn1)
conn1.open()
With the save-in-2010 file i got 0 errors.
With the one saved in 2007 i got
"External table is not in the expected format"
Is this string connection for both versions? Should i use Interop instead? (because the file is auto generated using Interop Excel 12.0 and it works in 2007 & 2010).
I already installed 2007 Office System Driver: Data Connectivity Components from http://www.microsoft.com/en-us/download/details.aspx?id=23734
Edit:
If i open the 2007 file in 2010 and save it, oleDB reads it ok.

It's a Bug already reported. Only Excel 2007 has this error and MS knows it but never addressed it.
This project can be only use w/ excel 2007.

Related

Excel connection manager error - importing from Table to Excel

I am getting below error while selecting Excel file after configuring connection manager.
I am using visual studio 2019 and Excel 2016.
Where am I going wrong?
Thanks
Ar

Is there a way to generate excel report in c# using interop excel with version indepent?

I am using Visual Studio 2019 and installed "Microsoft.Office.Interop.Excel V 15.0.4795.1000" using Nuget.
When I generating excel report it is working fine with "Microsoft Office 2013". But, getting error message with "Microsoft Office Home and Business 2019".
Error Message : Exception from HRESULT: 0x800A03EC Exception : System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
I assume that Interop Excel V 15 is not supporting with office 2019.
I used below code to create excel application.
using ExApp = Microsoft.Office.Interop.Excel;
ExApp.Application xlApp = new ExApp.Application();
Later, I also tried with below code thinking that it will work with multiple versions of excel.
Type ExcelType = Type.GetTypeFromProgID("Excel.Application");
dynamic xlApp = Activator.CreateInstance(ExcelType);
Is there a way we can generate excel report in c# on any version of excel (2007 to 2019)?
At least, I need solution for "Microsoft Office Home and Business 2019".

Visual Studio 2005 Reports and Windows 7

We have recently upgraded to windows 7 and have noticed that there are compatibility issues with my previous version of MS visual Studio 2005.
From taking a look around the web I believe that this issue is due to SP1 for Windows 7. My organisation will not get rid of SP1 just for one or two developers so I need to figure out a work around.
This is the issue...
I have an old MS visual studio website that has a report located on the home. This report was created in MS VS 2005.
Other versions of Visual Studio in have are 2010 and 2012. I have tried to convert the 2005 report into 2010 and this does state that it has been converted but I still cant open or do anything with the report. My 2005 web site is too large to convert or move into 2010 and we can still maintain this 2005 site by opening this up in 2010. It just seems to be a problem with the 2005 report.
I'm running out of options to make a simple change to a report. Anyone else got any ideas? I have even tried to create this report in 2010 and then add this to my 2005 site but this doesn't work.
Regards
Betty.
You say a report and then say that it is a whole site? Why not run a second site in tandom? Make a whole new site and name it differently like
http:// (servername)/Reports2012
Then put reports there. You cannot open a converted report in a site that is for a prior version, you can view it in Microsoft Business Intelligence Studio, BIDS, which is an add on to Visual Studio. If you can upgrade but cannot view it there, there is something wrong with the language file potentially. I would then make a copy of it in the old 2005 BIDS, then take that copy and see if you can upgrade that and if it will work. If that STILL does not work you could make a test report in BIDS 2010(SQL 2012 works on VS 2010, yes weird but true) to assure you can create reports there. Many times people try to open SQL Server 2012 Reports on VS 2012 and it won't work. You need 2010 add on you can find it under All Programs>MS SQL Server 2012>SQL Server Data Tools(They made the naming very confusing as it opens up and display BIDS, but calls itself 'Data Tools' under the programs). Every other version of SSRS lines up with that year of SQL Server to that year of VS. Not 2012.
If the report upgrade still does not work, yet you can create a run a new report fine; I would suggest potentially opening up the file dircectly. Your projects in a Reports solution generally have a file '(something).rdl' that RDL is the actual file and is just XML markup of the language. This is a last resort as you are essentially trying to do manually what the upgrade is failing to do in the xml. You merely copy a working report, and then paste the parts of the old report into their correct sections. Ensure the XML is valid as well.
If you cannot manage that to work you will need to recreate the report from scratch.

Export Excel 2003 file from MVC3

I found a nice solution to my problem which is export Excel 2003 file from MVC3. I used this code and it works perfectly but only with Excel 2007 and Excel 2010. What I need is some solution that will make this code to work with Excel 2003 as well. I guess there is a way to do that, but I am still looking for the solution. In my project I already use this code in many places and I don't really feel like changing it at whole. I will be very thankful if someone could help me.
Excel first began to use the xml-type spreadsheet in 2007. To get it into an Excel 2003 format, you would have to recreate the xls 2003 binary file format, which would be very difficult without using the Excel library.
There is a utility that allows 2003 users to open an xlsx file:
http://office.microsoft.com/en-us/excel-help/open-an-office-excel-2007-workbook-in-an-earlier-version-of-excel-HA010014107.aspx
That might help you on the client side.

Save PowerPoint 2007 as PowerPoint 2003 using Open Office SDK 2.0

Is there anyway to use the Open Office SDK 2.0 to save a PowerPoint presention that you created using OOXML to a PowerPoint 2003 presentation? I know if you open a 2007 file and click Save As you have the option to save it as a PowerPoint 97 to 2003 document and I didn't know if I could do this grammatically using this SDK.
The reason I am asking this question is because I need to give the user the option to save data on a website in either Office 2007 or 2003 format. I much rather just use the same code to produce the document instead of having to have two code paths for PowerPoint 2003 and PowerPoint 2007.
Unfortunately, no. Open Office SDK 2.0 is built for and around System.IO.Packaging to work with the Open Document Format (the zip package that wraps up all the xml and other files for Office 2007, XPS, etc.) in processing the ECMA/ISO standard for Office 2007/2010 formats.

Resources