Trying to create a 'Hole Filling' Macro and having problems with WELD in VBA

ANyone been around here long enough to remember CCCFER (Create Closed Curves From Enclosed Regions)??

Well all the tools exist in CorelCraw , have done for a while but I've never found a way to automate it, I keep trying and thought I'd give it another go with the help of CoPilot. HAH, completely useless.

So, the premise. I have a bunch of lines and curves all with an outline. I have a background rectangle the encloses them all. I want to turn the enclosed regions into fillable objects. Currently I use Tracev12 for this by exporting as a mono bitmap and trace outline with max details. Works well, however Trace v12 is unreliable on Win11 so I'm looking to the future and seeing if I can do something that works as quickly within Draw. For info, the export,trace,import takes less than a minute.

SO my procedure is 

Create 3 new layers, one for the trace and two for the trace background (one black fill one white as the trimming object)

Copy all the curves to the trace layer and turn of visibility of the original layer 1

Copy/create the trimming object to white background layer, copy the black background to the black background layer.

Select all on Trace layer, Break Apart to remove master clone relationships

Remove all Symbol instances by converting them to regular objects

Group everything, then ungroup All to remove nested layers.

Then convert all outlines to Object on Trace layer 

So far so good. The problem comes when I try and weld all these objects together. I tried combining first then welding to self like I would if doing it manually. I tried using the VB command Simplify but that gave errors too. Do I need to iteratively weld each curve to the next singularly? 

I enlisted the help of CoPilot but each suggestion was riddled with different errors, even errors that were the subject of a previous request. 

It appears there are problems with the VBA coding of Weld and Simplify, what do I need to be aware of when using weld in Draw2018? Are the issues resolved in later Draw versions?

And the bit I haven't got to yet is how I do  Front Minus Back on the traced objects using the white rectangle as the trimmer? 

I will post my VB attempt, but I need to go and tidy it up after CoPilot sent me down the wrong path. Rename the file to .cdr to use it.

TIA

Hywel Harris

TraceTest-LayersCreated1.zip