WilliamAnton
New Member
- Joined
- Feb 23, 2015
- Messages
- 6
Hello all. I used the following line of code...
Call Button_Differentials_ZeroOut
...to call another Button [Forms Control] and it blows up the Application.Caller in the "called" button with a "Run-time error '1004' - Unable to get the Buttons property of the Worksheet class. The specific line of code in the "called" button that the Debugger highlights is...
Set BUTTON = ActiveSheet.Buttons(Application.Caller)
I use the Application.Caller in the called button macro to help me create an anchor point (the cell reference/address for the button) from which I then create relative offsets so that any row from Step 1 through Step 31 on a Salary Schedule can find the same "constant value". This makes my 31 Step Schedule portable/dynamic; as such, when I copy the model and paste it under the current model I can create variations on the model based on alternative values for that constant. It's a comparison of costs modeling thing.
Maybe this explanation will help to better explain my overall goal. I wrote the Zero Out button which clears contents and locks fields in my variable/constants control matrix. This helps the user (me) to run new or different iterations through my model. It works well and I want to call the Zero Out button (macro) from another forms control macro. Really important feature would be to have the "relative addressing" in the Zero Out Button hold up. Having the "calling" control sending its parameters along to the Zero Out macro hurts me at this point, doesn't help me at this point.
Should I be trying the "Send Keys" function instead?
Thank you for your help.
Call Button_Differentials_ZeroOut
...to call another Button [Forms Control] and it blows up the Application.Caller in the "called" button with a "Run-time error '1004' - Unable to get the Buttons property of the Worksheet class. The specific line of code in the "called" button that the Debugger highlights is...
Set BUTTON = ActiveSheet.Buttons(Application.Caller)
I use the Application.Caller in the called button macro to help me create an anchor point (the cell reference/address for the button) from which I then create relative offsets so that any row from Step 1 through Step 31 on a Salary Schedule can find the same "constant value". This makes my 31 Step Schedule portable/dynamic; as such, when I copy the model and paste it under the current model I can create variations on the model based on alternative values for that constant. It's a comparison of costs modeling thing.
Maybe this explanation will help to better explain my overall goal. I wrote the Zero Out button which clears contents and locks fields in my variable/constants control matrix. This helps the user (me) to run new or different iterations through my model. It works well and I want to call the Zero Out button (macro) from another forms control macro. Really important feature would be to have the "relative addressing" in the Zero Out Button hold up. Having the "calling" control sending its parameters along to the Zero Out macro hurts me at this point, doesn't help me at this point.
Should I be trying the "Send Keys" function instead?
Thank you for your help.