Application.Run("DBRW"...) RECALC_0_3 in Worksheet_Change
Posted: Fri Sep 06, 2019 7:56 am
If I call the below Sub BuildModel directly then the Application.Run("DBRW") returns the value perfectly. However, if it gets called from the Worksheet_Change event I get a RECALC_0_3 error.
The Brand is getting passed fine; I've tried hard coding it and its the same result.
I've tried Application.Evaluate(DBRWString) and get the same result.
Strangely, I have a Application.Run("DBSS") on another sheet within a Worksheet_Change and it works perfectly. That doesn't require a return value though.
I've seen older posts in the forum on issues within the Worksheet_Change event but I think many of those have been addressed now.
I've got the latest PAx and Excel 365 (2019).
Anyone have any ideas for something that might kick it into action?
__________________________________________
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Sheets("Create Model").Range("E18")) Is Nothing Then
Call BuildModel
End If
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub BuildModel()
Dim Brand As String
Dim BrandCode As String
Brand = Sheets("Create Model").Range("E18").Value
BrandCode = Application.Run("DBRW", "CXMD:}ElementAttributes_Model", Brand, "Brand Code")
MsgBox (BrandCode)
End Sub
The Brand is getting passed fine; I've tried hard coding it and its the same result.
I've tried Application.Evaluate(DBRWString) and get the same result.
Strangely, I have a Application.Run("DBSS") on another sheet within a Worksheet_Change and it works perfectly. That doesn't require a return value though.
I've seen older posts in the forum on issues within the Worksheet_Change event but I think many of those have been addressed now.
I've got the latest PAx and Excel 365 (2019).
Anyone have any ideas for something that might kick it into action?
__________________________________________
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Sheets("Create Model").Range("E18")) Is Nothing Then
Call BuildModel
End If
End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub BuildModel()
Dim Brand As String
Dim BrandCode As String
Brand = Sheets("Create Model").Range("E18").Value
BrandCode = Application.Run("DBRW", "CXMD:}ElementAttributes_Model", Brand, "Brand Code")
MsgBox (BrandCode)
End Sub