Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Error 91 and 438
I have the following code: Option Explicit Sub ControlForms(varCode) If Chr(varCode) = "A" Then Unload AddOrFind AddTitle.Show ElseIf Chr(varCode) = "F" Then Unload AddOrFind GetTitle.Show ElseIf Chr(varCode) = "V" Then Unload AddOrFind Summary.Show End If End Sub Private Sub AddButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) ControlForms KeyCode End Sub Private Sub FindButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) ControlForms KeyCode End Sub Private Sub SummaryButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) ControlForms KeyCode End Sub When I press 'a' I get the desired result (AddOrFind userform pops up). When I press 'f' I get error 91 (Object variable or With Block variable not set) at GetTitle.Show. When I press 'v' I get error 438 (Object doesn't support this property or method) at Summary.Show. I have verified both userforms are under the correct name and the code compiles. What's the problem? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Error 91 and 438
Hi
Summary is a used property in excel, so you shouldn't use it as a userform name. Change the userform name and it should work. I am not sure about the GetTitle userform (it is at least not used in excel 2000), but it won't hurt to change this name too. Hopes this helps. .... Per On 30 Jun., 21:36, Bishop wrote: I have the following code: Option Explicit Sub ControlForms(varCode) If Chr(varCode) = "A" Then Unload AddOrFind AddTitle.Show ElseIf Chr(varCode) = "F" Then Unload AddOrFind GetTitle.Show ElseIf Chr(varCode) = "V" Then Unload AddOrFind Summary.Show End If End Sub Private Sub AddButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) ControlForms KeyCode End Sub Private Sub FindButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) ControlForms KeyCode End Sub Private Sub SummaryButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) ControlForms KeyCode End Sub When I press 'a' I get the desired result (AddOrFind userform pops up). * When I press 'f' I get error 91 (Object variable or With Block variable not set) at GetTitle.Show. *When I press 'v' I get error 438 (Object doesn't support this property or method) at Summary.Show. *I have verified both userforms are under the correct name and the code compiles. *What's the problem? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Error 91 and 438
Sometimes the problem is in the UserForm_Initialize code, but the debug highlight goes back to the call line. If you have such code, check it for a variable that is a rage object without the Set command. So I suspect the problem is in code withing UserForms GetTitle and Summary. "Bishop" wrote in message ... I have the following code: Option Explicit Sub ControlForms(varCode) If Chr(varCode) = "A" Then Unload AddOrFind AddTitle.Show ElseIf Chr(varCode) = "F" Then Unload AddOrFind GetTitle.Show ElseIf Chr(varCode) = "V" Then Unload AddOrFind Summary.Show End If End Sub Private Sub AddButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) ControlForms KeyCode End Sub Private Sub FindButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) ControlForms KeyCode End Sub Private Sub SummaryButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) ControlForms KeyCode End Sub When I press 'a' I get the desired result (AddOrFind userform pops up). When I press 'f' I get error 91 (Object variable or With Block variable not set) at GetTitle.Show. When I press 'v' I get error 438 (Object doesn't support this property or method) at Summary.Show. I have verified both userforms are under the correct name and the code compiles. What's the problem? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UserForm Error 459 | Excel Programming | |||
Userform Error | Excel Programming | |||
Userform Error | Excel Discussion (Misc queries) | |||
userform error | Excel Programming | |||
error in userform | Excel Discussion (Misc queries) |