I’m doing a small app in Excel, and I have the following code when the user clicks a Button in a UserForm
Private Sub SubmitNuevo_Click()
Call FindNextEmptyRow 'after this nextEmptyCell has a Range object
Dim currCell As Range
Set currCell = nextEmptyCell.Cells(1, 1)
Dim s() As String
s = Split("macro,name,area,dept,model,range,prior,found", ",")
currCell.Value = Date
For i = 0 To UBound(s)
currCell.Offset(0, dict.Item(s(i)) - 1).Value = Me.Controls(s(i) & "Nuevo").Text
Next
End Sub
When I just opened the Workbook and run this, it works fine, filling up a row of the Sheet with values from TextBoxes, but if I try to run it more times, it executes currCell.Value = Date and then just stops executing without an error or anything. If I re-open the workbook it works fine the first time I try to run it, but then fails every other try.
Any ideas what might be happening here?
Saving the Workbook after each click of the button appears to solve the issue. Just added
before the
End Sub.