この問題に遭遇したが、JavaScriptを使用している他の人のために、この回答をここに残しておきます。
ちょっとした背景... 私の会社では、JavaScript を使用して Excel を起動し、その場でスプレッドシートを生成するサード パーティの Web アプリを使用しています。[保存] ボタンの動作をオーバーライドする Excel アドインもあります。アドインを使用すると、ファイルをローカルに保存するか、オンライン ドキュメント管理システムに保存するかを選択できます。
Windows 7 と Office 2010 にアップグレードした後、スプレッドシートを生成する Web アプリに問題があることに気付きました。JavaScript が Excel でスプレッドシートを生成すると、突然 [保存] ボタンが機能しなくなりました。保存をクリックしても何も起こりませんでした。
ここで他の回答を使用して、JavaScript でソリューションを構築することができました。基本的に、メモリ内に Excel アプリケーション オブジェクトを作成し、特定のアドインを再読み込みして、保存ボタンの動作を元に戻します。これが私たちの修正の単純化されたバージョンです:
function GenerateSpreadsheet()
{
var ExcelApp = getExcel();
if (ExcelApp == null){ return; }
reloadAddIn(ExcelApp);
ExcelApp.WorkBooks.Add;
ExcelApp.Visible = true;
sheet = ExcelApp.ActiveSheet;
var now = new Date();
ExcelApp.Cells(1,1).value = 'This is an auto-generated spreadsheet, created using Javascript and ActiveX in Internet Explorer';
ExcelApp.ActiveSheet.Columns("A:IV").EntireColumn.AutoFit;
ExcelApp.ActiveSheet.Rows("1:65536").EntireRow.AutoFit;
ExcelApp.ActiveSheet.Range("A1").Select;
ExcelApp = null;
}
function getExcel() {
try {
return new ActiveXObject("Excel.Application");
} catch(e) {
alert("Unable to open Excel. Please check your security settings.");
return null;
}
}
function reloadAddIn(ExcelApp) {
// Fixes problem with save button not working in Excel,
// by reloading the add-in responsible for the custom save button behavior
try {
ExcelApp.AddIns2.Item("AddInName").Installed = false;
ExcelApp.AddIns2.Item("AddInName").Installed = true;
} catch (e) { }
}