Hey guys,
I have 2 subs. One sub that deletes all OLE SpinButtons, and one that Creates them.
If i run these two subs separately then it works just fine, but when i call both of them within a third sub, it freaks out and creates the buttons all out of order and linked to the wrong cells.
Here is the skeleton of my code:
Also posted question in:
ExcelForum: http://www.excelforum.com/excel-programming-vba-macros/1006817-refresh-ole-objects.html
OzGrid: http://www.ozgrid.com/forum/showthread.php?t=187898&p=711299#post711299
I have 2 subs. One sub that deletes all OLE SpinButtons, and one that Creates them.
If i run these two subs separately then it works just fine, but when i call both of them within a third sub, it freaks out and creates the buttons all out of order and linked to the wrong cells.
Here is the skeleton of my code:
Code:
'deletes and creates all spinners
Sub refreshSpinners()
Application.ScreenUpdating = False
deleteAllSpinners
createAllSpinners
Application.ScreenUpdating = True
End Sub
'clear all spin code - test code
Sub deleteAllSpinners()
For counter1 = 1 To Worksheets("Profiles").Cells(totalProjectsY, totalProjectsX)
deleteSpinCode (counter3)
deleteSpinButton (counter1)
Next
End Sub
'create all spin buttons test code
Sub createAllSpinners()
For counter1 = 5 To Worksheets("Profiles").Cells(totalProjectsY, totalProjectsX) + 4
addSpinCode (counter2 - 4)
createSpinButtons (counter2)
Next
End Sub
Also posted question in:
ExcelForum: http://www.excelforum.com/excel-programming-vba-macros/1006817-refresh-ole-objects.html
OzGrid: http://www.ozgrid.com/forum/showthread.php?t=187898&p=711299#post711299
Last edited: