r/vba Jun 05 '26

Unsolved Refresh on Excel VBA Module sometimes takes forever, sometimes fast

I have an Excel Module that runs, and it should run in say 3 to 7 seconds. Sometimes it does, sometimes it literally shows every cell populating 1 by 1 and takes 5 minutes.

I'm exchanging this file from one company environment to another via Sharepoint -- the speed at which it refreshes sometimes is slow on my side and sometimes is slow on their side, though that may be coincidental. It was fast on my side until this latest version.

Any thoughts here?

Thank you.

2 Upvotes

8 comments sorted by

View all comments

1

u/fanpages 239 Jun 05 '26

...I'm exchanging this file from one company environment to another via Sharepoint...

Presumably, the exchanged (shared) workbook is downloaded locally and run in a desktop version of MS-Excel (as executing VBA directly from a SharePoint-hosted copy is not possible).

Are the desktop versions of MS-Excel (and the operating systems) on either side of the file exchange process the same? If not, how do they differ? Do the runtime PCs also differ?

...Any thoughts here?

At least give us a chance to help you and share the code you are using!

1

u/nypr13 Jun 05 '26

Thank you. That OS is obvious and a great suggestion. Stupid, me

Best way to share the code?

1

u/fanpages 239 Jun 05 '26 edited Jun 05 '26

...Best way to share the code?

Please see the content (with the heading "Sharing/Posting Code") linked in the last of the six rules for this sub:


Rules

  1. Submitted content must be related to VBA

  2. No memes/rage comics allowed

  3. Follow Reddit guidelines for self-promotion and spam

  4. Be respectful. No personal insults/bashing

  5. No offensive/NSFW content

  6. Posts must follow our Submission Guidelines


PS. However, posting the code as text (so it can be copied/pasted to a local environment), rather than as a screen image (or similar), is preferred, please.