-
Run-time error '13': Type mismatch in Object Sheet13(Market Scanner)
Am I getting this from a cell with a non-numeric value? Do I need some validation before executing the line "cellStatus = Cells(rowMod, controlCol).value" ?
[vba]
Option Explicit
Dim genId As Integer
Const reqOffset = 4
Const controlCol = 1
Const pageCol = controlCol + 1
Const activateCol = controlCol + 2
Const baseX = 2
Const baseY = 2
Const topic = "scan"
Const monitorStart = "firstScanRow"
Const monitorEnd = "lastScanRow"
Const serverCell = "scanServer"
Const errorRange = "scanErrorPosition"
Const scanCtrl = "scanCtrl"
Sub Worksheet_Calculate()
Dim rowMod As Integer, cellStatus As String
' On Error Resume Next
For rowMod = Range(monitorStart).value To Range(monitorEnd).value
cellStatus = Cells(rowMod, controlCol).value ' Run-time error '13': Type mismatch error on this line
If cellStatus = ArrayQueries.RECEIVED Then
Dim server As String, id As String, request As String, theName As String, TheArray() As Variant
server = util.getServerVal(serverCell)
If server = "" Then Exit Sub
id = ArrayQueries.extractid(Cells(rowMod, controlCol).Formula)
request = ArrayQueries.idToRequest(id)
TheArray = ArrayQueries.doRequest(server, topic, request)
theName = ArrayQueries.composeName(Cells(rowMod, pageCol).value, id, topic)
Call ArrayQueries.populatePage(theName, theName, TheArray, baseX, baseY, Cells(rowMod, activateCol).value)
End If
Next rowMod
End Sub
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules