One way of adding script to form at run time
You will have to modify the code for your application
Set fAuto_Form = ThisWorkbook.VBProject.VBComponents.Add(3)
fAuto_Form.properties("Width") = 800
With fAuto_Form.CodeModule
X = .CountOfLines
.InsertLines X + 1, "Sub CommandButton1_Click()"
.InsertLines X + 2, " GETOPTION_RET_VAL=False"
.InsertLines X + 3, " Unload Me"
.InsertLines X + 4, "End Sub"
.InsertLines X + 5, "Sub CommandButton2_Click()"
.InsertLines X + 6, " Dim ctl"
.InsertLines X + 7, " GETOPTION_RET_VAL = False"
.InsertLines X + 8, " For Each ctl In Me.Controls"
.InsertLines X + 9, " If ctl.Tag < """" Then If ctl The
GETOPTION_RET_VAL = ctl.Tag"
.InsertLines X + 10, " "
.InsertLines X + 11, " Next ctl"
.InsertLines X + 12, " MsgBox battery.value"
.InsertLines X + 13, " dvalue1 = battery.value"
.InsertLines X + 14, " stcomponent = component.caption"
.InsertLines X + 15, " Unload Me"
.InsertLines X + 16, "End Sub"
End Wit
--
instruit
I am B.E. Instrumentation and Control and write now working as Hardwar
design engineer in automotive electrconics industr
-----------------------------------------------------------------------
instruite's Profile:
http://www.excelforum.com/member.php...fo&userid=2653
View this thread:
http://www.excelforum.com/showthread.php?threadid=39800