Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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
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
UserForm Error 459 Jimmah Excel Programming 1 August 7th 07 01:39 PM
Userform Error TonTon165 Excel Programming 4 May 7th 07 07:45 PM
Userform Error Steve B Excel Discussion (Misc queries) 2 February 6th 07 04:26 PM
userform error peter Excel Programming 0 May 1st 06 10:47 PM
error in userform damorrison Excel Discussion (Misc queries) 6 April 23rd 06 03:18 PM


All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"