I apologize in advanced, I am very new to VBA.
Is it possible to create a macro (in my personal.xlsb) that actually creates a macro in another workbook? The macro in the personal.xlsb would go into a worksheet in another workbook, create a macro in a module, insert a form control button and assign the macro to the form control button. I've tried doing this while with the recorder and all it records is adding a button. It doesn't record anything else that I am doing in the VB editor screen.
Basically, I have a couple dozen workbooks that other people use that have an ActiveX button that don't work right now (because of the Dec. 2014 Microsoft update). I want to create a macro that goes in to these workbooks, deletes the ActiveX button(that's done below), inserts a new form control button (that's done below) and creates/assigns a new macro to it (is this possible?). Here is what I have...
Running excel 2013. Inserting the code to delete the Microsoft temp files for everyone else's computers is not really an option either at this point. Thanks for any insight you can offer. Thanks
Is it possible to create a macro (in my personal.xlsb) that actually creates a macro in another workbook? The macro in the personal.xlsb would go into a worksheet in another workbook, create a macro in a module, insert a form control button and assign the macro to the form control button. I've tried doing this while with the recorder and all it records is adding a button. It doesn't record anything else that I am doing in the VB editor screen.
Basically, I have a couple dozen workbooks that other people use that have an ActiveX button that don't work right now (because of the Dec. 2014 Microsoft update). I want to create a macro that goes in to these workbooks, deletes the ActiveX button(that's done below), inserts a new form control button (that's done below) and creates/assigns a new macro to it (is this possible?). Here is what I have...
Code:
Sub FixActiveX()
'delete CommandButton
Sheets("Week 1 Printable Schedule").Select
ActiveSheet.Unprotect Password:="password"
ActiveSheet.Shapes.Range(Array("CommandButton1")).Select
Selection.Delete
''need to create macro here, macro name= W1RevertToMaster
'''code for W1ReverToMaster = Sheets("Week 2 Printable Schedule").Range("WeekSchedPrint2[[Monday]:[Sunday]]").Value = Sheets("Master Schedule").Range("Week[[Monday]:[Sunday]]").Value
'add form control button
ActiveSheet.Buttons.Add(763.5, 39, 73.5, 72.75).Select
Selection.Characters.Text = "Click HERE to Revert to Master Schedule"
With Selection.Characters(Start:=1, Length:=39).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
'need to assign W1RevertToMaster macro to form control button here
End Sub
Running excel 2013. Inserting the code to delete the Microsoft temp files for everyone else's computers is not really an option either at this point. Thanks for any insight you can offer. Thanks