javascript - ActiveX 证书
问题描述
我找到了一个脚本,可以通过网页在特定工作表上打开 excel。
我遇到了一个问题,因为每次我尝试打开它时都会收到一条错误消息,指出 ActiveX 控件未签名。我需要解决此问题,而不是使用允许未签名的 ActiveX 控件之类的解决方法,因为此功能将在我办公室中的每个人的 Intranet 站点上使用。
代码:
<!DOCTYPE html>
<script type="text/javascript">
function Open_Excel_File(path,sheet)
{
fso = new ActiveXObject("Scripting.FileSystemObject");
if (!fso.FileExists(path))
alert("Cannot open file.\nFile '" + path + "' doesn't exist.");
else
{
var myApp = new ActiveXObject("Excel.Application");
if (myApp != null)
{
myApp.visible = true;
Book = myApp.workbooks.open(path);
var excel_sheet = Book.Worksheets(sheet).Activate;
myApp.range(f_range).Select;
}
else {
alert ("Cannot open Excel application");
}
}
}
</script>
<button onclick="Open_Excel_File('C:\\Users\\sodonnell\\Desktop\\test1.xlsm', 'sheet2');">Rawr</button>
解决方案
推荐阅读
- python - 不同行为递归二叉树输出列表v.字符串
- java - 错误:无法从同一包中的类中找到符号
- python-sphinx - 关于“1.4 版更改:词汇表术语的索引键应视为实验性”的“实验性”
- java - 我是否正确地为我的链表程序编写了复制构造函数?
- python - 带有特定输出的 Collatz 计数?(输入步数和步数)
- django - Django将现有代码从两个因素身份验证集成到基于通用类的视图中
- javascript - 覆盖发布请求
- android - 退出应用后Android容器变换图像保留
- windows - Windows 上的 Golang 和 GoCV - MatchTemplate 导致异常
- node.js - 当新人访问该站点时,OAuth 不需要重新登录