另存时,我点取消,弹出个Excel,如何不让它弹出呢?代码:
<html>
<head>
<title>save as</title>
</head>
<body>
<script type="text/javascript">
function SaveAs(){ var Excel, Book;
Excel = new ActiveXObject("Excel.Application");
// Create a new work book.
Book = Excel.Workbooks.Add();
var ExcelSheet = Book.Worksheets(1);
var fileDialog = Excel.FileDialog(2); // 2 保存
fileDialog.show();
var savePath = fileDialog.SelectedItems(1);
// Save the sheet.
Book.SaveAs(savePath);
//Excel.Book.Close();
Excel.Quit();}
</script>
<input type="button" value="保存" onclick="javascript:SaveAs()">
</body>
</html>
<html>
<head>
<title>save as</title>
</head>
<body>
<script type="text/javascript">
function SaveAs(){ var Excel, Book;
Excel = new ActiveXObject("Excel.Application");
// Create a new work book.
Book = Excel.Workbooks.Add();
var ExcelSheet = Book.Worksheets(1);
var fileDialog = Excel.FileDialog(2); // 2 保存
fileDialog.show();
var savePath = fileDialog.SelectedItems(1);
// Save the sheet.
Book.SaveAs(savePath);
//Excel.Book.Close();
Excel.Quit();}
</script>
<input type="button" value="保存" onclick="javascript:SaveAs()">
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货