Set Button Caption

N

Nigel

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
 
J

John Bundy

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.
 

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