Value of variable(i).IsUserPrompt

Hi,
I’m using VBA to insert default value on user prompt before refresh. For this, I have a macro which use :

ThisDocument.Variables("MyPromptName").value=MyValue

Sometimes, the property IsUserPrompt of my variable change to False and the prompt isn’t display anymore.

Anyone knows the reason of this changing?

Thanks in advance.

Fandor


ChristopheA :fr: (BOB member since 2003-09-04)

What version of BusObj? We use this extensively under v5, and have never had this happen.

Having written that statement, I can think of how this is possible. If the prompt is removed from the data provider(s), then it would behave just as you stated. Your line of code will happily “re-create” a new entry with that name in the ThisDocument.Variables collection, but it won’t be a user prompt. I occasionally use this feature as a scratch-pad of sorts … a place to store something, without creating a DocumentVariable that is visible to the user in Reporter.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Hi Dwayne,

The version is 5.1.3
According to your answer, I wonder if it’s not due to the order of creation. If the VBA line was created and ran before than the user prompt was created… I think it’s what happened.

Thank you for you answer, it reassures me to know that it is a stable methode.

Fandor


ChristopheA :fr: (BOB member since 2003-09-04)

Yes, that is quite likely the reason.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)