VBAacad2007
Technical User
I'm writing these code for VBA in AutoCAD 2007
I keep getting "Run-time error 13 : Type mismatch" on line as indicated in the attached code below. Thanks in advance!
Private Sub UserForm_Activate()
With cboInch
.AddItem "3/12"
.AddItem "1/64"
.AddItem "3/4"
.AddItem "1/2"
.AddItem "1/4"
.AddItem "3/16"
.AddItem "1/8"
.AddItem "3/32"
.AddItem "1/16"
End With
With cboFoot
.AddItem "1"
.AddItem "10"
.AddItem "15"
.AddItem "20"
.AddItem "25"
.AddItem "30"
.AddItem "40"
.AddItem "50"
.AddItem "60"
.AddItem "100"
End With
End Sub
Private Sub btnConvert_Click()
tboScaleFactor.Value = cboFoot.Value * 12 / cboInch.Value
'''got error "Run-time Error #13 : Type Mismatch"
'coverted to type double --does not work
' tboScaleFactor.Value = CDbl(cboFoot.Value * 12 / cboInch.Value)
' MsgBox "Inch Value: " & cboInch.Value
' MsgBox "Foot Value: " & cboFoot.Value
End Sub
I keep getting "Run-time error 13 : Type mismatch" on line as indicated in the attached code below. Thanks in advance!
Private Sub UserForm_Activate()
With cboInch
.AddItem "3/12"
.AddItem "1/64"
.AddItem "3/4"
.AddItem "1/2"
.AddItem "1/4"
.AddItem "3/16"
.AddItem "1/8"
.AddItem "3/32"
.AddItem "1/16"
End With
With cboFoot
.AddItem "1"
.AddItem "10"
.AddItem "15"
.AddItem "20"
.AddItem "25"
.AddItem "30"
.AddItem "40"
.AddItem "50"
.AddItem "60"
.AddItem "100"
End With
End Sub
Private Sub btnConvert_Click()
tboScaleFactor.Value = cboFoot.Value * 12 / cboInch.Value
'''got error "Run-time Error #13 : Type Mismatch"
'coverted to type double --does not work
' tboScaleFactor.Value = CDbl(cboFoot.Value * 12 / cboInch.Value)
' MsgBox "Inch Value: " & cboInch.Value
' MsgBox "Foot Value: " & cboFoot.Value
End Sub