Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
マクロの開始時に、ユーザーがワークブックを保存するオプション (変更を行った場合) を取得できるようにしたいと考えています。どうすればこれを達成できますか?
私はもう試した:
ThisWorkbook.Save
残念ながら、プロンプトは生成されません。
私も試しました:
ThisWorkbook.Save(ThisWorkbook.FullName)
ただし、既存のファイルを上書きするかどうかをユーザーに確認するため、必要なプロンプトとは異なるプロンプトが表示されます。
独自のプロンプトでラップするだけです:
If Not ThisWorkbook.Saved Then If MsgBox("Do you want to save the file before continuing?",vbYesNo,"Save?") = vbYes Then ThisWorkbook.Save End If End If