Welcome to the forum.
The event handler you're using is Workbook_BeforeSave. This will be called every time you try to save the workbook. Inside the event handler, you have this code which tries to save the workbook:
So you can see that this will cause the procedure to call itself and you'll end up in an unintended loop:
To avoid this loop, you need to temporarily disable application events by setting Application.EnableEvents to False. The key to this is you must explicitly set it back to True again, even if an error occurs. Taking this into account, I think your code would look something like this:
However, I'm not keen on the solution for a couple of reasons. The main reason is that if the user disables macros then they'll be able to save over the file without interference, so it's not very robust. Wouldn't it be better to password protect the workbook, giving the relevant people read-only access?
Bookmarks