i use excel 2003. I have written following code in 'this workbook' as it has to run when the workbook is opened.
but for some reason it gives error on line with 'Set'. I need help to set this right.
Thanks!
Code:
Dim ctrlarray(1 To 5) As Excel.OLEObject
Dim i As Integer
For i = 1 To 5
Set ctrlarray(i) = ActiveSheet.OLEObjects.Add("Commandbutton1")
Next i
Thanks!