Home > Web Front-end > JS Tutorial > Code example for reading local Excel file contents through Javascript_javascript skills

Code example for reading local Excel file contents through Javascript_javascript skills

WBOY
Release: 2016-05-16 16:53:05
Original
1603 people have browsed it

Javascript code to read the contents of the local Excel file:

Copy the code The code is as follows:



Required conditions:

1. The client must install the Microsoft Excel activex control (just install the full version of Microsoft office), and allow it to run when the browser pops up the prompt "This website needs to run the following add-ons...", otherwise js code will error when creating Excel.Application object.
2. JS reading local Excel files involves security issues. The Microsoft Excel activex control does not have execution permissions under the default settings. The solution is as follows:
a. Click the browser "Tools" -> "Internet Options" -> "Security" and select "Trusted Sites".
b. Click the "Site (S)" button to add this website to the list;
c. Click "Custom Level (C)..." and find "ActiveX Controls and Plug-ins" in the security settings Under the "Initialize and script ActiveX controls not marked as safe for scripting" node, set it to "Enabled".

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template