IanGalletly
Programmer
Can anyone point me in the right direction to setting the 'Require Variable Declaration' in code so it can be temporarily set to false?
I have a form which breaks down an SQL string to a string which can be pasted into VBA module to a assign it to a variable. The Form also allows a block of VBA code to be converted back into an SQL statement.
The latter is achieved using VBA Extensibility functionality by creating a temporary module and function containing the code block. The function is then called to return the SQL string.
Everything works correctly unless the code block fails to compile for one reason or another.
When working I have the option 'Require Variable Declaration' set. This means the temporary module is getting 'Option Explicit' included. If I set this option to false the call to the newly created function just returns nothing in most of the problem cases. A result I can easily live with as the form has 'undo' functionality allowing the user to get back to the code display and fix the problem.
If the 'Require Variable Declaration' can not be set, can anyone suggest an alternative method to handle a failure for the code to compile?
I have a form which breaks down an SQL string to a string which can be pasted into VBA module to a assign it to a variable. The Form also allows a block of VBA code to be converted back into an SQL statement.
The latter is achieved using VBA Extensibility functionality by creating a temporary module and function containing the code block. The function is then called to return the SQL string.
Everything works correctly unless the code block fails to compile for one reason or another.
When working I have the option 'Require Variable Declaration' set. This means the temporary module is getting 'Option Explicit' included. If I set this option to false the call to the newly created function just returns nothing in most of the problem cases. A result I can easily live with as the form has 'undo' functionality allowing the user to get back to the code display and fix the problem.
If the 'Require Variable Declaration' can not be set, can anyone suggest an alternative method to handle a failure for the code to compile?