What you request is not possible. But I don't understand how, if you're
writing the code, you don't know in advance whether or not the variable
exists. If you expect to need it, just declare it. It won't hurt anything if
it's never used.
If the variable could be declared in a different module that may or may not
be present, that's a different story... but I still don't think there's any
solution.

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
> Hi,
>
[quoted text clipped - 26 lines]
>
> Michiel.
Michiel - 21 Dec 2007 15:28 GMT
Thanks Jay!
The reason why I want it is the fact that I want to use the sub in many
different applications.
If the Public Variable is necessary I needs to be declared of course but if
it is not used I do not want to pollute my codings with Publics wich are not
used.
M.
>What you request is not possible. But I don't understand how, if you're
>writing the code, you don't know in advance whether or not the variable
[quoted text clipped - 10 lines]
>>
>> Michiel.
Jay Freedman - 21 Dec 2007 18:16 GMT
As attractive as the idea of keeping your projects "clean" may be, it
doesn't do any good if it doesn't work.
Maybe you should think about passing the variable as an argument instead of
declaring it as Public. Then only the projects that call this procedure need
to know about the argument. It also reduces the chance that the Public
variable might be corrupted by other procedures that mistakenly use its
name.
> Thanks Jay!
>
[quoted text clipped - 20 lines]
>>>
>>> Michiel.
Michiel - 21 Dec 2007 19:10 GMT
Jay,
I follow your wise advise!
Thanks, and,...
HAPPY HOLIDAYS!
M.
>As attractive as the idea of keeping your projects "clean" may be, it
>doesn't do any good if it doesn't work.
[quoted text clipped - 10 lines]
>>>>
>>>> Michiel.