We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issue with .XLSX format

Hi,

I am using Aspose.Cells.dll (5.3.1.0) in my project to convert our XML file to XLS or XLSX format.

Conversion is working fine.

After conversion I try to import the date from the converted XLSX file, in to blank Excel file using following procedure

Open Excel 2010
go to Data tab
click on From other sources - > from Microsoft query
select Excel Files.* in database tab
select the converted excel file from the location where it is stored
Expand the Process Elements

and you will see the error message
"Unexpected error from external database driver (1)."
------------------------------------------------------------
This whole thing works fine if the file is converted in XLS format
------------------------------------------------------------
The above procedure also works fine if we open the converted XLSX file and save it again in Excel and then try to import data it does not show any error messsage.

I am attaching converted XLSX file using Aspose.Cells.dll, just in case if you want to reproduce it.

can you please help me

Thanks

Hi,


Could you try our latest version/fix: Aspose.Cells for .NET v7.1.0.5

If you still find the issue, kindly attach your source XML file here, we will check your issue soon.

Thank you.

Hi,

Thanks for your reply.

I have tried with the latest version and I am still getting the same error message.

I am attaching our XML file.

just to let you know that I am passing this XML as stream to aspose and then saving it in XLSX format.

Thanks

Hi,

I loaded your xml file and saved it in xlsx format, it is working fine.

Please download the latest version:
Aspose.Cells
for .NET v7.1.0.
6


See the following code and the output file.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\d3.xml”;


Workbook workbook = new Workbook(filePath);

workbook.Save(filePath + “.out.xlsx”);

Hi,

I did mention in my first mail that it is converting from XML to XLSX format properly, its failing when you try to use that converted file for importing data to blank Excel file.

Conversion is working fine.

After conversion I try to import the date from the converted XLSX file, in to blank Excel file using following procedure

Open Excel 2010
go to Data tab
click on From other sources - > from Microsoft query
select Excel Files.* in database tab
select the converted excel file from the location where it is stored
Expand the Process Elements

and you will see the error message
"Unexpected error from external database driver (1)."
------------------------------------------------------------
This whole thing works fine if the file is converted in XLS format
------------------------------------------------------------
The
above procedure also works fine if we open the converted XLSX file and
save it again in Excel and then try to import data it does not show any
error messsage.

Can you reproduce this issue on your machine?

if possible can we do live chat ?

Thanks

Hi,


Did your try v7.1.0.6 Shakeel Faiz used? I could not find the issue in MS Excel 2007 precisely. Please give us the screen shots of the steps in MS Excel and attach them to point out the issue. We will log your issue soon.

Thank you.

Hi,

I have tried the latest version of Aspose dll (7.1.0.6), but I am still getting the same error message.

I am attaching our .XML file(d3.xml) and below is the code how I convert my .XML file to XLSX file
----------------------------------------------------------------------------------------------
Public Shared Function AsConvertXML(ByVal stream As IO.Stream, ByVal filename As String, ByVal intfilterindex As Integer) As String

'Dim license As Aspose.Cells.License = New Aspose.Cells.License()
'license.SetLicense(“Aspose.Cells.lic”)

Dim wb As Workbook
Dim strerror As String = “”
Try
wb = New Workbook(stream)
If intfilterindex = 1 Then
wb.Save(filename, Aspose.Cells.SaveFormat.Excel97To2003)
ElseIf intfilterindex = 2 Then
wb.Save(filename, Aspose.Cells.SaveFormat.Xlsx)
End If
Catch ex As Exception
strerror = ex.ToString
Return strerror
End Try
End Function
-----------------------------------------------------------------------------------------------
once the file is converted to .XLSX format I open that file in blank Excel Sheet.
I have attached .XLSX file (d3.xlsx).

I have attached 5 screen shots which shows the steps to reproduce the error message

Image 1.jpg---- shows open new excel sheet in Excel 2010
Image 2.jpg---- shows go to from Microsoft Query
Image 3.jpg---- shows after clicking on Microsoft Query, dialog box appears to select the data source in our case it would be Excel Files.* and click OK
Image 4.jpg---- shows select the Excel file which in our case it would be d3.xlsx file and click OK
Image 5.jpg---- shows when you expand Process Elements you get the error message.

If you need any thing else do let me know

Thanks

Hi,


Could you test your steps in MS Excel 2007, I could not evaluate/test it as MS Query is not installed on my MS Excel 2010 version. I have tested it in MS Excel 2007 though even using your attached d3.xlsx file, it works fine and I can extract data from the source tables.

Thank you.

Hi,

I have tried the steps on MS Excel 2007 and I am getting different dialog box saying

“ODBC Excel Driver Login Failed” and error message inside it is "External table is not in the expected format"

Any ideas why its not working?

Thanks

Hi,


That is really strange. I am not sure if this is an issue with our product or something else at your side as it works fine in my Excel 2007. I do not get any error but as you mentioned that you are getting error in Excel 2010 and 2007 (as well) as per your posted steps and screen shots (in the previous posts).

Anyways, we need to thoroughly investigate the issue, we will do it soon. A ticket is logged with an id: CELLSNET-40372. We will look into it.


Thank you.

Hi,

For this issue, please let use following option for saving the xlsx file:

C#


OoxmlSaveOptions opt = new OoxmlSaveOptions();

opt.ExportCellName = true;

wb.Save(result, opt);

Hi,

This seems to be working fine.

I am not getting any error message after importing data.
we will be doing some more testing and see if any everything is ok.

Thanks for sorting that out.

just out of curiosity, what I was doing wrong in the code that I send in previous post ?

Thanks for your help

Hi,

Actually, we do not export the cell name in default mode, so the output file is generally smaller than Excel.

If ExportCellNames is true, the cell name will be exported to generated file.