VBA code running slower over time

abeyer99

New Member
Joined
Jun 20, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Bit of a weird one here. I have a VBA macro that is designed to bill credit cards that appear on an Excel Sheet in a few steps:
1. Gather all the necessary data which appears on 2 different sheets in the active workbook
2. Call a Python script to do all the API calls with the credit card service we use
3. Read the output of the Python script and update the Excel sheet with the information in the output

The code is correct; it does exactly what I want it to do. However, it starts to get slower as I run it again-and-again. Around 50 times running the same macro without changing anything, it starts to get noticeably slow. Then after about 100 times, the code doesn't even run and gives me an error "Can't execute code in break mode" (See attached screenshot). Any ideas about what could be causing the issue? I can post the code if requested.

IMG_9071.jpg
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top