D
dienkwik
I wanted to have a function that can be invoked from one of the cells in
a worksheet that can change the color of the cell where the function is
invoked.
I inserted a new module in under the workbook and created a function to
do that.
The thing that frustrates me is that I seem to be able to read all the
properties of the objects that was passed in (in this case a range
object for the cell whose color I need to change), but I can't actually
modify any of them. I think it actually crashes, meaning the rest of
the code was not executed, and the cell where the function was invoked
displays "value!"
I have even tried changing the values directly in the debugger, but it
didn't take it either.
I then tried creating a macro and pasting the same code in and this
time it works fine.
I then thought maybe if I create a function that calls a macro that it
may work, but the same thing happened again, i.e. it didn't work. In
fact it actually stops the debugger. In the cell where the function is
invoked it says "value!"
Is there some kind of scope problem that I'm having, i.e. for some
reason I am not allowed to change properties of objects that I invoked
from the worksheets or something like that ?
Anybody has any idea what I should do ?
Thanks alot in advance.
Dien.
a worksheet that can change the color of the cell where the function is
invoked.
I inserted a new module in under the workbook and created a function to
do that.
The thing that frustrates me is that I seem to be able to read all the
properties of the objects that was passed in (in this case a range
object for the cell whose color I need to change), but I can't actually
modify any of them. I think it actually crashes, meaning the rest of
the code was not executed, and the cell where the function was invoked
displays "value!"
I have even tried changing the values directly in the debugger, but it
didn't take it either.
I then tried creating a macro and pasting the same code in and this
time it works fine.
I then thought maybe if I create a function that calls a macro that it
may work, but the same thing happened again, i.e. it didn't work. In
fact it actually stops the debugger. In the cell where the function is
invoked it says "value!"
Is there some kind of scope problem that I'm having, i.e. for some
reason I am not allowed to change properties of objects that I invoked
from the worksheets or something like that ?
Anybody has any idea what I should do ?
Thanks alot in advance.
Dien.