I’m writing VBA in Microstation and I want to populate a text field PathToScan
with the active design file’s path, which is ActiveDesignFile.Path
.
What I’m currently attempting has worked just moments ago but for some reason isn’t working now.
This is the code I’m using to populate the text field.
Private Sub UserForm_Initialize()
Debug.Assert TypeOf Me.PathToScan Is TextBox
Debug.Assert TypeName(ActiveDesignFile.Path) = "String"
Debug.Assert ActiveDesignFile.Path <> ""
Me.PathToScan.Text = ActiveDesignFile.Path
Debug.Print Me.PathToScan.Text, ActiveDesignFile.Path
Debug.Assert Me.PathToScan.Text = ""
Do Until Me.PathToScan.Text = ActiveDesignFile.Path
Me.PathToScan.Text = ActiveDesignFile.Path
Debug.Assert Me.PathToScan.Text = ActiveDesignFile.Path 'this is where it catches
Loop
End Sub
What should I be looking for to overcome this?