Hi all.
You see when you make a procedure that has an optional parameter and you want to give the optional parameter a default, you do something like:
or you can use a constant (either a system constant or a user defined constant will work) for the default like:
So that's all cool.
But I tried to use a variable for the default and Excel wasn't having any of it. I get an error message saying "Compile error: Constant expression required". So that means I can't use a variable! FS
In my code there is a variable that holds the name of the current "thing" that the code is working on (a filename actually). When I call this particular procedure, I want it to execute based on whatever I pass to it as the parameter, or if there's no parameter passed, I want it to execute on whatever the current "thing" is that the code is working on instead.
It seems to me that I should be able to use a variable but clearly I'm not allowed.
Anyone any idea how I can achieve something similar here?
Bookmarks