Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your responses. I'll go with Jim's suggestion 2 PuboStyle =
oStyle in the function and delete oStyle as a global. Geoff "Bob Phillips" wrote: As it is public, being in a module should not matter. Where does the function get called, and with what values? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Geoff" wrote in message ... oMsgBox configures the message box ie width, height and shows the message and required buttons. As the responses are needed elsewhere in the code I set Boolean values to each button. I have put the function in a module - should it be in the form code? Geoff "Bob Phillips" wrote: If oStyle is a global variable, why is it also an argument to oMsgBox? What does oMsgBox do? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Geoff" wrote in message ... I cannot work out why the variable oStyle is not 'seen' by the message form's cmdOkNo_Click procedure. Should be simple but I've gone blank: From a form I call a custom message box form which can have a combination of Yes, No, Cancel or OK cmdbuttons. However I use only 3 buttons by switching No and Ok on the same button. The messaging and configuring of the message box is done in a module: Public Function oMsgBox1(oStyle As String, oNumPrompts As Long, Prompt1 As String, Prompt2 As String, Prompt3 As String, Prompt4 As String, Title As String) ..code End Function The oStyle string can be "OK" or "YNC" or "YN" oStyle, boMsgYes, boMsgNo, and boMsgCancel are declared globally elsewhere. In the message form code I have: Private Sub cmdOkNo_Click() If oStyle = "YN" Or oStyle = "YNC" Then ''' oStyle remains "" boMsgNo = True End If other stuff End Sub Private Sub cmdYes_Click() boMsgYes = True other stuff End Sub Private Sub cmdCancel_Click() boMsgCancel = True other stuff End Sub T.I.A. Geoff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-Time error '91': Object variable of With block variable not set | Excel Programming | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |