

Setting Application.EnableEvents to false didn't seem to do anything neither did setting Application.Interactive to false. I've also researched some ways to prevent this from occurring. (I've printed enough debug statements to the Immediate window to write a novel!) When I step through the code, it works, but when I just run it, that line is ignored. So, after clicking the weapon button, all weapons disappear and the turn happens. My first thought to prevent the issue was to hide the button after the player clicks. However, the button keeps "listening" for additional clicks, restarting the button code once the first run-through finishes.

The problem I'm having is that when the player clicks on a weapon, my button code runs.

(This is testing so ignore the health numbers.) The player has 3 possible weapons to choose from. The player is down in the lower left and the enemy is in the upper right. This is the userform for the turn-based battle system in my Excel RPG. This goal of this project was to demonstrate my abilities in VBA, which is why I am also posting this file to a public GitHub repo.Ībout to pull my hair out trying to figure this one out! I know the game will not be balanced, as actual RPGs go through extensive player testing to get everything "feeling" right, but that's okay. My final task, once all the systems are built, is to actually make the level.

Was debating how that would work so put that off for later. I also need to add UI to the main view to track player XP and health. Still to finish is the game loop itself, including allowing the player to open the inventory menu before starting a battle, along with finishing the battle process to identify the winner. (In my screenshot, I set the probability for a new weapon to 100% so I could get this example.) I also added the capability to open a treasure chest and get loot, including the possibility for a new weapon or shield. Tonight, I finished up the inventory and fixed some bugs I had when leaving the inventory view and then returning later. As the month comes to a close, I am working on finishing my RPG built entirely in Microsoft Excel using VBA.
