Thanks BradV.

That does not work for me. I have tried something similar but it refuses to create the new key. The values get created fine once the keys and parents key exist.