M
Michiel
Hi,
I should like to write a sub that MIGHT write data to a public variable.
Meaning:
-If the Public variable exists the sub assigns a value.
-If the public variable does not exist. It just ignores it.
For example:
------------------------------------------------------------------------------
----------------
Option Explicit
Public strOutsideVar as String 'This line might be present
Sub TheSub()
Dim strInsideVar as String
strInsideVar = "Hallo" & strInsideVar
strOutsideVar = strInsideVar 'Only be executed if the public variable
(strOutsideVar is available)
End Sub
I have the "Option Explicit" switched on.
If the Public Variable is absent , upon running I get a compile error message.
How can I prevent that or how could I get the idea implemented?
Thanks
Michiel.
I should like to write a sub that MIGHT write data to a public variable.
Meaning:
-If the Public variable exists the sub assigns a value.
-If the public variable does not exist. It just ignores it.
For example:
------------------------------------------------------------------------------
----------------
Option Explicit
Public strOutsideVar as String 'This line might be present
Sub TheSub()
Dim strInsideVar as String
strInsideVar = "Hallo" & strInsideVar
strOutsideVar = strInsideVar 'Only be executed if the public variable
(strOutsideVar is available)
End Sub
I have the "Option Explicit" switched on.
If the Public Variable is absent , upon running I get a compile error message.
How can I prevent that or how could I get the idea implemented?
Thanks
Michiel.