Databases Reference
In-Depth Information
Dim SendString$, varyval As Integer
If vary = True Then varyval = 1 Else varyval = 0
'Set the Value for the Given Fitting Parameter
SendString$ = "nlsf.p" & Trim(str(nlsf_p_number)) & "=" &
Trim(str(param_value)) & ";"
DDEExecute Channel, SendString$
'Allow Parameter to Vary in Fitting Session?
SendString$ = "nlsf.v" & Trim(str(nlsf_p_number)) & "=" &
Trim(str(varyval)) & ";"
DDEExecute Channel, SendString$
End Sub
Once all the data have been written to the proper areas of the Origin Worksheet and the proper
initial parameters have been set, all that is left to do is remotely “push” the button on the Origin
Worksheet from Excel. The next subroutine accomplishes this.
Sub Click_Button()
Select Case frm9OrigDDE!monoOptionButton.value
Case True
'"PUSH" the mono pka fit button on the Worksheet using
Labtalk Code
DDEExecute Channel, "DDEfit!Text.run();"
Case False
'"PUSH" the bis pka fit button on the Worksheet using
Labtalk Code
DDEExecute Channel, "DDEfit!Text1.run();"
End Select
End Sub
Once the regression process has completed, the fitted parameters must be returned to the GUI
in Excel. The following subroutine accomplishes this and utilizes the RequestData function to
return the parameters calculated in Origin.
Sub Get_Parameters()
'Erase any pre-existing parameters
Workbooks(pKaDataBook).Worksheets(1).Cells(13,
(Asc(frm9OrigDDE.TextBox_Array) - 64)).value = ""
Workbooks(pKaDataBook).Worksheets(1).Cells(14,
(Asc(frm9OrigDDE.TextBox_Array) - 64)).value = ""
Workbooks(pKaDataBook).Worksheets(1).Cells(15,
(Asc(frm9OrigDDE.TextBox_Array) - 64)).value = ""
frm9OrigDDE!pKa1TextBox.Text = ""
frm9OrigDDE!pKa2TextBox.Text = ""
frm9OrigDDE!codTextBox.Text = ""
'Fetch Most Current Curve Fit Parameters - Write to Worksheet
& Form (GUI)
Select Case frm9OrigDDE!monoOptionButton.value
Search WWH ::




Custom Search