Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Error with Calendar object and CommandButton

Hi, I have never worked with calendar object yet, so here's my
question:

Private Sub Workbook_Open()
CommandButton1.Caption = "Import the list of matches from " &
Calendar1.Value
End Sub

Run-time error '424':
Object required.


Why...?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Error with Calendar object and CommandButton

i think u have not inserted calendar...

"Morris" wrote:

Hi, I have never worked with calendar object yet, so here's my
question:

Private Sub Workbook_Open()
CommandButton1.Caption = "Import the list of matches from " &
Calendar1.Value
End Sub

Run-time error '424':
Object required.


Why...?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Error with Calendar object and CommandButton

Hi Morris,

Try something like:

'=============
Private Sub Workbook_Open()
Dim SH As Worksheet
Dim myCB As OLEObject
Dim myCal As OLEObject

Set SH = Me.Sheets("Sheet2") '<<==== CHANGE

Set myCB = SH.OLEObjects("CommandButton1")
Set myCal = SH.OLEObjects("Calendar1")

myCB.Object.Caption = "Import the list of matches from " _
& myCal.Object.Value
End Sub
'<<=============


---
Regards,
Norman


"Morris" wrote in message
ps.com...
Hi, I have never worked with calendar object yet, so here's my
question:

Private Sub Workbook_Open()
CommandButton1.Caption = "Import the list of matches from " &
Calendar1.Value
End Sub

Run-time error '424':
Object required.


Why...?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Error with Calendar object and CommandButton


Norman Jones wrote:
Hi Morris,

Try something like:

'=============
Private Sub Workbook_Open()
Dim SH As Worksheet
Dim myCB As OLEObject
Dim myCal As OLEObject

Set SH = Me.Sheets("Sheet2") '<<==== CHANGE

Set myCB = SH.OLEObjects("CommandButton1")
Set myCal = SH.OLEObjects("Calendar1")

myCB.Object.Caption = "Import the list of matches from " _
& myCal.Object.Value
End Sub
'<<=============


---
Regards,
Norman


Thanks Norman, it is working now :)

Muhameed: funny guess :)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar Object in Excel Calendar Object in Excel Excel Discussion (Misc queries) 2 February 10th 10 10:16 PM
Object Calendar 11.0 Pat Excel Discussion (Misc queries) 1 January 9th 07 10:10 PM
use of calendar object? CathyZ Excel Discussion (Misc queries) 1 May 4th 06 07:14 PM
Running a CommandButton in Excel I get this error Bert[_4_] Excel Programming 4 May 5th 04 07:06 PM
Object Calendar 8.0 braziliandude Excel Programming 1 February 3rd 04 03:47 PM


All times are GMT +1. The time now is 01:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"