Excel VBA connected to external files

TomExcel1234

New Member
Joined
May 17, 2021
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
Hello,

i would appreciate any help in building macro for the task below, please. Heres a brief summary:

Issue:
I have list of image frames in sequential order (for instance from frame 1 to frame 10'000 or 20'000). The frames are either in .jpg or .png format. The issue is that from time to time, some frames are missing = for instance, the frame sequence would be .... 10'000.png, 10'001.png, 10'002.npg, 10'004.png... etc (hence frame 10'003.png missing).

Desired Macro:
The macro should go into the folder and see what frames are missing in sequence. If no frames are missing => do nothing. If frames are missing => then macro should take previous frame, copy it and rename it to fill the sequence. For instance:

Before macro is run:
Sequence would be .... 10'000.png, 10'001.png, 10'002.png, 10'004.png (one frame 10'003.png is missing)
After macro is run:
Sequence would be .... 10'000.png, 10'001.png, 10'002.png, 10'003.png 10'004.png (frame 10'003.png is a copy of 10'002.png to fill the sequence)


In case multiple frames are missing in a row, then the logic remains the same:

Before macro is run:
Sequence would be .... 10'000.png, 10'001.png, 10'002.png, 10'006.png (three frames 10'003.png, 10'004.png and 10'005.png are missing)
After macro is run:
Sequence would be .... 10'000.png, 10'001.png, 10'002.png, 10'003.png 10'004.png, 10'005.png, 10'006.png (frames 10'003.png, 10'004.png and 10'005.png are all a copy of frame 10'002.png to fill the sequence)

The macro would be based on naming of the files only. It would neither open nor analyze frames themselves.


Thank you very much for any help.

Best regards.
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,855
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
Glad it worked.
Please mark post #8 as solution for future readers.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,110
Messages
5,768,156
Members
425,458
Latest member
Jaspal1996

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
Top