I am trying to extract data from an excel file and the following script only works on IE. Is there a generic process available that will work on IE,chrome,FireFox and mozilla?
Here is the code I currently have:
There are a couple of items here:
- Excel spreadsheet file (XLSX)
- File in C:\Temp
The short answer is that ActiveX objects is only supported by Internet Explorer (also it requires Excel to be installed ("Excel.Application").
A possible approach, specially if you are going to do this from a Mobile device, would be to process the XLSX file on the server (either with Excel.Application or other libraries) and return a JSON file to the client with the data.
I hope this helps.
ELCB Information Services (Pty) Ltd
Customer Service Email
E A S T
L O N D O N
Fax: +27(43) 704 0701
J O H A N N E S B U R G
Tel: +27(11) 879 6179
Fax: +27(11) 454 0384
P O R T E L I Z A B E T H
Tel: +27(41) 373 0529
Fax: +27(86) 650 0135
A possible approach, specially if you are going to do this from a Mobile device, would be to process the XLSX file on the server (either with Excel.Application or other libraries) and return
a JSON file to the client with the data.
this post as spam/abuse.
I see that this is a scenario where you want to upload an XLSX file to server.
For a Mobile device, something to keep in mind that iOS does not provide a file system that you can browse for files.
Also, each app runs in a sandbox.
Perhaps, you could do this on Android using a PhoneGap plugin.
Still, the workflow of an app on a Mobile device would not be the same as on a Desktop computer.
Could you provide more information on what is the use case that your are trying to solve?
How does the XLSX file get to the Mobile device?
I am considering that your target platform is Android (but some of this can also apply to iOS).
Copy and paste seems simple enough. However, you would depend on the app that opens the XLSX file to provide the right format so that you can process the text unambiguously.
Also, the interaction does not seem use friendly. (User has to do copy on an app that works with XLSX files then switch to your app and paste the text into a text area field.)
Using an import wizard would depend on being able to access the file on the file system.
Files owned by an app are only accessible by the app. If the XLSX file is stored in External Storage then it is public and available to any app. (This could be a security issue.)
I believe that the best approach to do what you intend to do is to use Intents.
I tried to find a PhoneGap plugin that worked with Intents but I only found the WebIntent Android Plugin.
Other possible approaches here could be to have a service where you receive the XLSX file via email or have it shared via a DropBox.
Perhaps, others in the forum have tried to solve a similar use case and have some suggestions.