Can't open excel file with SSIS unless it is manually saved - excel

I'm having an issue processing an excel file with SSIS unless I manually open the file and click 'save'.
I've noticed that it doesn't mater if the file is .xls or .xlsx
The file is downloaded to excel from an SSRS project
I am able use a File System Task to move, rename, delete, etc. the file, but when I try to use a dataflow task to access the contents inside the file I get an error that the external table is not in expected format.
I then have to open up the file, click save, and the file processes fine.
Not sure if this means anything but....
I've noticed that when I open the original file in notepad the top line includes with:
xl/workbook.xml
After I save the file the top line changes to:
[Content_Types].xml 
Using Microsoft Visual Studio 2012.
ERROR:
Error: 0xC0202009 at TransferMoneyReconcile, Connection manager "Excel Connection Manager": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft Office Access Database Engine" Hresult: 0x80004005 Description: "External table is not in the expected format.".
ExcelConnectionString:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\192.168.234.567\ftp\Sample\Money\Archive_Transfer Money to Manager.xlsx;Extended Properties="EXCEL 12.0 XML;HDR=NO";
any help/suggestions are appreciated!
Thanks!
Steven

XLSX extension is of 2 types.
Excel workbook (let's call this type 1)
Strict Open XML Spreadsheet (let's call this type 2)
Both the above have the .xlsx extension.
To see this yourself, you can open the excel application, create a new file, click on save and notice the type 1 (located at top of the list) and type 2 (located at the bottom of the list).
The default option is type 1 - Excel workbook. So when you create a new file and save, it will get saved as type 1.
Based on my testing, however, when you open a type 2 file and save, then it may get saved as type 1 or type 2. This behaviour is not guaranteed.
Anyways, to resolve the error you are facing, open the file and save it (via save as) and choose type 1 format. Then test the SSIS, it should run without the error.

This might throw more light on it. The questions remain:
Why can't SSRS output in the standard Excel Workbook format?
Why can't SSIS load the Strict Open XML Spreadsheet format?

Related

When report was downloaded from the Oracle ebs Excel report.While I am trying to open it was generating an error

The file format and extension of 'Accounts.xls' don't match. The file could be corrupted or unsafe. Unless you trust its source, don't open it. Do you want to open it anyway?
It was generating this error while I am trying to open the downloaded excel report from the Oracle ebs
I don't know what to do
the Oracle EBS BI Publisher cannot create real xlsx Excel output files and generates and xml (xslt) format instead, which is given the extension xls to open automatically in Excel. Excel detects that the content does not match the expected binary xls format and shows the warning.
To avoid this problem, you can use third party products like blitz report.

warning message in excel file

I code an asp file to response an excel file using Excel.Application object. I change the content type below.
Response.ContentType = "application/vnd.ms-excel"
When user downloads this file and open it, he get the following message.
The file format and extension of 'test.xls' don't match. The file
could be corrupted or unsafe. Unless you trust its source, don't open
it. Do you want to open it anyway?
I don't want to give this message to use. How can I remove this message from excel file.
This is due to a feature in MS Excel called Extension Hardening. There are 2 ways to fix this problem
You need to generate proper XLS files that are truly excel files, not HTML Tables saved with XLS extension
Each of the client machines need a registry tweak as explained here

Office Invalid XML error, file still opens in Office

I have an .xlsx file that when run through the open Office SDK 2.5 generates an error that the document is invalid and contains multiple validation errors involving the slicerCache and invalid attribute values.
I can attach more information about the actual XML if needed from the xlsx file, however my question is actually this. Excel still opens the document without an error. Not even a request to "repair" the document.
I am curious why using the Microsoft open office XML SDK generates validation errors, yet office is still able to open these documents.
Does office make a best guess? Or is the SDK given by microsoft not entirely accurate??
Thanks.
This is a formatting issue as far as I can tell. When you save it in xlsx it saves it as a workbook, not a spreadsheet. I would save it in a different file format or see if there libraries that your sdk needs in order to process the xlsx. I've never worked with office sdk, but I get similar errors when I open xlsx in other programs. 99% of the time I can just change the format. (if you live dangerously you can just manual change the file extension in your folder to something itll read.)

Error debugging SSIS (excel source, data conversion, OLE DB destination)

I am having issues creating a good data flow from Excel Source to SQL DB in BIDS 2010. I'm using 32-bit runtime, i have windows authentication on the SQL Server. I'm trying to send the data to a table that has no relationships or constraints at all. My excel file is .xls and I've tried doing this to SS2012 and SS2008R2 databases, getting the same errors back.
Here's my Package Validation Error:
Error at Data Flow Component [SSIS.Pipeline]: "component "Source for Excel Connection Manager" (1)" failed validation and returned validation status "VS_ISBROKEN".
Error at Data Flow Component [SSIS.Pipeline]: One or more component failed validation.
Error at Data Flow Component: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)
Please check at this URL, I have commented earlier today.
BIDS Package Error's on Truncate while EXPORTING to flat file
Some suggestion as well:
1) Check the Data type in excel source. If the Source data type is different Convert or cast them as it is in Database.
2) Map the column correctly. Check if there are not null field in the destination.
3) Make sure you change the Project properties to RUN64bits to FALSE
This may not relate, but I was getting a very similar error while trying to write data to Excel from global tables. Turned out to be an issue with the Connection Manager for the database. I had to set "RetainSameConnection" to True and it started working right away. Again, this may be unrelated to your issue, and this is several months later, but it could be a solution for someone else that runs into the problem.
Again this may not be the case always but for me the excel was corrupted.
I followed these steps after wasting 3 hours:
tried to open the source excel file, it didn't open and prompted the file is corrupted.
recreated the excel file from the source, saved as excel (.xlsx) file
recreated the connection manager and edited excel source
and everything works fine.

Macro broken after server migration

After migrating my files from one server to another (the network location of the files has changed and my computer is different also) I get the following error when I run a macro in an Excel workbook named control_reativa.xlsm:
Run-time error '1004':
Cannot open PivotTable source file 'F:\Tools\Tecnica[Medidas Tecnica
(2012-2013)v4.0.xlsm]F2013'.
It seems I need to add access to the other .xlsm file but I can't figure how to achieve this. I've been looking all over and have read that I need to add Extensibility 5.3 Library to the project but this doesn't seem the solution since I've never required something like that in the other computer/network.

Resources