Databases Reference
In-Depth Information
Range("pKa1").Value =
ThisWorkbook.ObjOrigin.LTVar("nlsf.p4")
Range("pKa2").Value =
ThisWorkbook.ObjOrigin.LTVar("nlsf.p5")
End Select
'Write Goodness of Fit Parameters to specified Excel
Worksheet Range
Range("rcsq").Value =
ThisWorkbook.ObjOrigin.LTVar("nlsf.chiSqr")
Range("ssq").Value =
ThisWorkbook.ObjOrigin.LTVar("nlsf.ssr")
Range("cod").Value =
ThisWorkbook.ObjOrigin.LTVar("nlsf.cod")
Range("dof").Value =
ThisWorkbook.ObjOrigin.LTVar("nlsf.dof")
'Get fit curve values from Origin
Dim fit(1 To 101, 1 To 2) As Double
Set rngFitCurve = Range("FitCurve")
rngFitCurve.Value =
ThisWorkbook.ObjOrigin.GetWorksheet("FitCurve")
'Tell Origin to copy an image of the graph to the clipboard
bRet = ThisWorkbook.ObjOrigin.CopyPage("FitResult", 4)
'Now create a new chart and paste graph image from
On Error Resume Next
Worksheets(1).ChartObjects(1).Activate
With ActiveChart
.ChartArea.Clear
End With
With ActiveSheet.ChartObjects.Add _
(Left:=207, Width:=368, Top:=457, Height:=325)
.Chart.Paste
End With
End Sub
In order for the code in the Button_Fit_Click subroutine to function correctly, the user
must first connect to an instance of Origin (using the push buttons on the sheet), pick the pKa
fitting function (to fit the data to), and pick the data set of interest (from the combo box). Notice
that the combo box contains the names of all the data sets contained in the SampleData Worksheet
(Figure 9.30). This is accomplished using the following subroutine:
Sub HeadersToCombobox(Combo As Object, Headers() As String,
wkbook As String, _
wksheet As String, Optional ByVal startcol = 1, _
Search WWH ::




Custom Search