Desktop Settings when saving Error "Object variable not set"

When I save any Desktop Setting then I get the Error “Object variable not set”

The error occurs in the routine Policy Management / Remove Fields.

Set itemToRem = hPolicy.GetFirstitem(“RemParameters”)

itemtoRem.saveToDisk = False

I think the settings are working.

has anyone any idea?

Subject: What is the debugger telling you?

When you turn on the debugger, where does the code crash and can you see which variable is not set properly?

Subject: things to look at

Set itemToRem = hPolicy.GetFirstitem(“RemParameters”) hPolicy is not set
itemtoRem.saveToDisk = False more likely itemtoRem is nothing because RemParameters does not exist on hPolicy doc

Subject: Question

Are you having the issue with editing just old desktop polices? Is there a issue when you create a new desktop policy? Since the issue is with the policy document did you try refreshing the design of the document to the latest nab design? You might be be able to trick it out and run a simple agent against the doc that adds a field RemParameters = “xxxx” (field RemParameters := “xxx”) so it would exist when the save code runs, The agent should be run from the view level on the doc in question

Subject: What is the debugger telling you?

When you turn on the debugger, where does the code crash and can you see which variable is not set properly?