Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Set Button Caption

I am trying to set button caption by using code but it is failing can someone
please point out what I should be doing

the error is Object Variable or With Block Variable not set



Dim mode As String
mode = EssVGetGlobalOption(5)
Set btn = Application.CommandBars.ActionControl
If mode = 4 Then
x = EssVSetGlobalOption(5, 2)
btn.Caption = "Warnings On"
Else
x = EssVSetGlobalOption(5, 4)
btn.Caption = "Warnings Off"
End If


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Set Button Caption

without knowing what EssVGetGlobalOption is it is hard to tell. I set x to 4
and 3 and it worked with both so it is probably this function you are calling.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Nigel" wrote:

I am trying to set button caption by using code but it is failing can someone
please point out what I should be doing

the error is Object Variable or With Block Variable not set



Dim mode As String
mode = EssVGetGlobalOption(5)
Set btn = Application.CommandBars.ActionControl
If mode = 4 Then
x = EssVSetGlobalOption(5, 2)
btn.Caption = "Warnings On"
Else
x = EssVSetGlobalOption(5, 4)
btn.Caption = "Warnings Off"
End If


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
Change caption of a button Dylan @ UAFC[_2_] Excel Worksheet Functions 3 November 25th 08 07:04 PM
command button caption LesHurley Excel Programming 2 November 16th 07 11:14 PM
Toggle Button Caption 5elpep Excel Programming 1 August 10th 07 09:28 AM
How to change Button Caption? BrianB Excel Programming 3 June 1st 05 06:24 PM
Caption of a button Dr_Phil Excel Programming 4 May 4th 04 09:13 PM


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