error 1004 Why

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
 
J

Jim Cone

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
 
F

Filips Benoit

Sorry,

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

My CmdButton was not a OLEObject !

Filip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top