ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   form won't unload (https://www.excelbanter.com/excel-programming/299487-form-wont-unload.html)

inquirer

form won't unload
 
Could someone tell me what is wrong with the following code snippet. At the
end, the form still remains visible. I have tried inserting
elliottinput.hide before the unload but it still is visible.

elliottInput.Show
flname = elliottInput.TextBox25.Value
' check that a data path to directory has been entered
Do
If Not bOK Then Exit Sub
If elliottInput.TextBox26.Value < "" Then Exit Do
MsgBox " A path to the data file directory must be entered "
elliottInput.TextBox26.SetFocus
elliottInput.TextBox26.SelStart = 0
elliottInput.TextBox26.SelLength = 1000
elliottInput.Show
Loop
If elliottInput.ListBox2.Value = "BACKTEST" Then
sd = elliottInput.TextBox3.Value
Else
sd = "01/01/1901"
End If
pp = elliottInput.TextBox1.Value
lrtr = elliottInput.TextBox4.Value
urtr = elliottInput.TextBox18.Value
sp = elliottInput.TextBox24.Value
dataPath = elliottInput.TextBox26.Value
antype = elliottInput.ListBox2.Value
lors = elliottInput.ListBox3.Value
If elliottInput.TextBox27.Value < "" Then
edate = elliottInput.TextBox27.Value
Else
edate = "31/12/2099"
End If
Unload elliottInput

The form works ok and all data are properly collected but it won't unload
till the end of the program

Thanks
Chris



BrianB

form won't unload
 
You have this line *within the Do...Loop*
elliottInput.Show

Perhaps poor old Excel gets confused

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 09:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com