Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello Everyone,

I am facing some difficulty in reading the data from FTP. I have downloaded the file from FTP and saved locally and when I am try to read to the excel I am getting the below error.

"External table is not in the expected format".

If I am save the file with other name with save as, when I am reading its working.

I observed that when I am save as the file size is coming some 33 kb. Before save as original file size is 9 kb.

Can you please let me know where the issue is and help me.

Thanks in advance.

Thanks,
Sujju


What I have tried:

I saved the file with save as and reading the file its working. But original file downloaded from FTP is not working.
Posted
Updated 25-Apr-19 3:51am
Comments
F-ES Sitecore 25-Apr-19 8:04am    
You probably have a problem with your code.
phil.o 25-Apr-19 8:43am    
Hard to tell. Maybe something with the FTP transfer method you used. Make sure to use binary transfers maybe?
Richard MacCutchan 25-Apr-19 8:57am    
Please provide some clearer details. For example, are you trying to open the file in Excel, or some other application?

1 solution

You're probably using the wrong connection string.

For XLSX files:
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + [filepath] + ";Extended Properties=Excel 12.0";

For XLS files:
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" + [filepath] + ";Extended Properties="Excel 8.0;HDR=YES;"
 
Share this answer
 
Comments
Richard MacCutchan 25-Apr-19 10:55am    
The ACE library can handle both types.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900