Hello,
I'm looking to make a button that, as part of the macro it runs, deletes itself.
This is what I have so far
It all works fine, but with the addition of the first line to make the button delete itself, it errors there. 1004 Unable to get the OLEObjects property of the worksheet class. Could it be that the macro is in a different workbook? Either way I have no idea how to fix it. Other fixes I found on google haven't helped. I've made sure ActiveX is enabled.
Also, how do I know the button's name? I've assumed it's the "Button 1" that shows up in the top left of excel below the ribbon when I select the button.
I'm looking to make a button that, as part of the macro it runs, deletes itself.
This is what I have so far
Code:
ActiveSheet.OLEObjects("Button 1").Delete
Application.Calculate
Range("TimeSheet[Date(s)]").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Also, how do I know the button's name? I've assumed it's the "Button 1" that shows up in the top left of excel below the ribbon when I select the button.