fetch_excel関数の呼び出し後に、updateProgress関数を呼び出して進捗バーと読み込まれたレコード数を更新することができます。
function execute() {
for (let i = 0; i < cnt; i++) {
const path = document.all["path" + i].value;
fetch_excel(path);
updateProgress(i + 1);
}
}
function fetch_excel(path) {
// 指定されたパスのExcelを開き、データを読み込む
}
function updateProgress(processedCount) {
const totalFiles = cnt;
const progress = (processedCount / totalFiles) * 100;
document.getElementById("progress").style.width = progress + "%";
document.getElementById("notice").innerHTML = "読み込み済みレコード数: " + processedCount;
}
updateProgress関数は処理済みのファイル数をパラメータとして受け取り、進捗のパーセンテージを計算して進捗バーの幅(width)を更新します。また、読み込まれたレコード数をnotice要素に表示します。