Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Changing the SpinButton value in Workbook_Open()

Changing the properties of controls on a worksheet is slightly different
from changing controls on an UserForm.

The main difference is the way controls should be called.

I assume you have two "Spinners" in Sheet1.
See the macro below.

Private Sub Workbook_Open()
With ThisWorkbook.Worksheets("Sheet1")
.DrawingObjects("Spinner 1").Value = 10
.DrawingObjects("Spinner 2").Value = 100
End With
End Sub

"DrawingObjects" is a very safe way to refer to controls on a worksheet. All
controls can be referred to as DrawingObjects.


Regards,
Edwin Tam

http://www.vonixx.com



On 1/15/05 1:08 PM, in article
, "Tony Steane"
wrote:

Greetings One and All,

I have two SpinButtons on a worksheet and I am trying to change the
value of each button as I open the Workbook. Each button will have
a different value assigned.

I have tried the obvious :

Private Sub Workbook_Open()

Spinbotton1.value = 10
Spinbutton2.value = 24 both are random numbers each time.

end sub

However I recieve the error "didn't provide a valid object qualifier".

My knowledge is such that I am unable to find out how this is done.

Would somebody please provide me with a solution and if possible a web
site where this topic is discussed. ( in simple terms if possible.)

Cheers

Tony


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Changing the SpinButton value in Workbook_Open()

If the were spinbuttons from the control toolbox toolbar, I think you would
have to use:

With ThisWorkbook.Worksheets("Sheet1")
.DrawingObjects("Spinner 1").Object.Value = 10
.DrawingObjects("Spinner 2").Object.Value = 100
End With

--
Regards,
Tom Ogilvy

"Edwin Tam" wrote in message
...
Changing the properties of controls on a worksheet is slightly different
from changing controls on an UserForm.

The main difference is the way controls should be called.

I assume you have two "Spinners" in Sheet1.
See the macro below.

Private Sub Workbook_Open()
With ThisWorkbook.Worksheets("Sheet1")
.DrawingObjects("Spinner 1").Value = 10
.DrawingObjects("Spinner 2").Value = 100
End With
End Sub

"DrawingObjects" is a very safe way to refer to controls on a worksheet.

All
controls can be referred to as DrawingObjects.


Regards,
Edwin Tam

http://www.vonixx.com



On 1/15/05 1:08 PM, in article
, "Tony Steane"
wrote:

Greetings One and All,

I have two SpinButtons on a worksheet and I am trying to change the
value of each button as I open the Workbook. Each button will have
a different value assigned.

I have tried the obvious :

Private Sub Workbook_Open()

Spinbotton1.value = 10
Spinbutton2.value = 24 both are random numbers each time.

end sub

However I recieve the error "didn't provide a valid object qualifier".

My knowledge is such that I am unable to find out how this is done.

Would somebody please provide me with a solution and if possible a web
site where this topic is discussed. ( in simple terms if possible.)

Cheers

Tony




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
Substitute for OLE SpinButton? Daystrom Excel Discussion (Misc queries) 2 January 29th 09 09:10 PM
Spinbutton pcor New Users to Excel 2 November 6th 07 03:16 PM
Spinbutton Ben B Excel Discussion (Misc queries) 3 March 9th 06 11:38 AM
spinbutton? CG Rosén Excel Programming 1 November 29th 04 11:16 PM
SpinButton Rounding Up Randal W. Hozeski Excel Programming 5 December 23rd 03 08:12 PM


All times are GMT +1. The time now is 09:37 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"