Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Import XLS files without Excel
Message
From
01/12/2018 04:22:12
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01663866
Message ID:
01663957
Views:
45
>>>>>>>>>>>>>I might be wrong, but I thought there was a tool that allows importing XLS files without having Excel installed?
>>>>>>>>>>>>
>>>>>>>>>>>>Unzip the xlsx, and then in the xl subfolder there's sheet1.xml, sheet2.xml etc. Then read the xml and get the values.
>>>>>>>>>>>
>>>>>>>>>>>PMFJI, but how do you Unzip an xlsx file? I am using legacy pkzip25.exe but I can't figure what you mean.
>>>>>>>>>>
>>>>>>>>>>Dmitry, if you rename the file's extension to zip, you can unzip directly from the Windows Explorer.
>>>>>>>>>
>>>>>>>>>You are right. Thank you, Antonio!
>>>>>>>>
>>>>>>>>If I'm not mistaken ZIP file capability has been built-in as far back as WinMe and WinXP (where they were referred to as "compressed folders"). As previously mentioned, if you change the extension you can usually extract and add files through Explorer with the what is built into Windows without adding any software. There are occasions however that you may need the add-in software like PkZip for Windows, WinZip, WinRAR, etc. when you're dealing with ZIP archives that use some of the newer compression or encryption modes.
>>>>>>>
>>>>>>>Yes, I was able to extract the files from the xlsx. But the result is not really helping me. I don't have the skills to parse and get the real "data" out of the resulting xml files.
>>>>>>
>>>>>>I was at the same point. First I was happy to see the files extracted, but then when looking the files I realized it is a lot of work to put this together. All strings are in a separate file and there is some logic based on the order.
>>>>>>
>>>>>>But this is the code that helped me further, it uses exactly this structure and parses it to a pre-created cursor.
>>>>>>
>>>>>>http://praisachion.blogspot.com/2015/06/append-from-xlsx.html
>>>>>
>>>>>I tried this but I cannot get it to works.
>>>>
>>>>
>>>>I am now working on it, if I succeed I will let you know
>>>
>>>I think it relies on WinRar.exe (just from scanning the source). Please let me know if you get it to work.
>>
>>I don't have WinRar installed, only 7 zip.
>>
>>What I found out, the sheets must be called sheet1, sheet2 sheet3 etc.
>>
>>When the names of the worksheets are different, an error appears "Cannot find sheet1".
>>
>>Is this the same error you got?
>>
>>After renaming the worksheets it imported correctly.
>
>I was testing against the existing (in the download) spreadsheet, besici.xlsx and it does have the sheet named sheet1.
>I don't remember what error I got.


Perhaps there are then other dependencies, but I am using a fairly new laptop where I don't have many things installed.

The test with besici.xlsx did work right away, so if you can run it again and check the error it should be possible to find out what is missing.
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform