PDA

View Full Version : Form Error Type Not understood



ameritecc
03-04-2008, 04:50 PM
The following code is just a macro like 80 to 90 others that I have created and used in the same workbook. This one when activated however gives a error message that says "Runtime Error 13 Type Mismatch". I have checked and double checked all possibilities for this error that I know could be causing it, including the assigned macro name, the spelling versus the form spelling etc. Can anyone help me with this. There is no difference in this code macro format than in any other I use in this workbook, and I have never had a message error related to this. Could this be caused by actual code embedded in the form itself?

Public Sub RolodexMainForm_Open()
'
' RolodexMainForm_Open Macro
' Macro recorded 03/03/2008 by Dennis
'
RolodexMainForm.Show
End Sub

Simon Lloyd
03-04-2008, 06:06 PM
From the information you have given then i have to say there is no problem, but the fault could lie elsewhere in your workbook but only creating a fault when you call the userform, perhaps the userform has an initialize section of code that could be causing a problem.

ameritecc
03-04-2008, 06:11 PM
Yes there is an initialize section of code in this form. It is listed below. I thought the same thing as you however...there should be no problem. I reviewed this initialize code several times but my expertise in bebugging is no better than my coding abilities. Trying however.

My form Initialize form Code:
Private Sub UserForm_Initialize()
'Clean data range
'DeleteBlankRows
'DeleteBlankColumns

'Set properties of listbox1
With Me.ListBox1
.BoundColumn = 1
.ColumnCount = 1
.ColumnHeads = False
.TextColumn = True
.RowSource = "Sheet32!A3:I" & xlLastRow("Sheet32")
' .ListStyle = fmListStyleOption
.ListIndex = 0
End With
End Sub

Simon Lloyd
03-04-2008, 06:46 PM
I'm not too sure, i have never seen this annotation

"Sheet32!A3:I" & xlLastRow("Sheet32")

before so can't comment but i take it sheet 32 exists and that this is right?, perhaps try a simple rowsource in its place and try again if its still the same it isn't that ;)

Bob Phillips
03-05-2008, 01:34 AM
I notice that you are binding 9 columns but have set the columncount to just 1, althoug I admit that doesn't fail for me.