error 1004 Why

  • Thread starter Thread starter Filips Benoit
  • Start date Start date
F

Filips Benoit

Dear All,



Code below triggers error 1004: Property OLEObjects of Class Worksheet
cab't be found ( translation from Dutch)



Public Sub ResizeCommandButton(ByVal strCommandButtonName As String)

ActiveSheet.OLEObjects(strCommandButtonName).Object.Top = 10

ActiveSheet.OLEObjects(strCommandButtonName).Object.Left = 20

ActiveSheet.OLEObjects(strCommandButtonName).Object.Height = 30

ActiveSheet.OLEObjects(strCommandButtonName).Object.Width = 40

End Sub
 
It seems you have gone an object too far.
Try...
ActiveSheet.OLEObjects(strCommandButtonName).Top = 10
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(free and commercial excel programs)

..
..
..

"Filips Benoit" <[email protected]>
wrote in message
Dear All,
Code below triggers error 1004: Property OLEObjects of Class Worksheet
cab't be found ( translation from Dutch)

Public Sub ResizeCommandButton(ByVal strCommandButtonName As String)
ActiveSheet.OLEObjects(strCommandButtonName).Object.Top = 10

ActiveSheet.OLEObjects(strCommandButtonName).Object.Left = 20

ActiveSheet.OLEObjects(strCommandButtonName).Object.Height = 30

ActiveSheet.OLEObjects(strCommandButtonName).Object.Width = 40
End Sub
 
Sorry,

ActiveSheet.OLEObjects(strCommandButtonName).Top = 10 is OK

My CmdButton was not a OLEObject !

Filip
 
Back
Top