Excel VBA - IR控制图使用的LaunchSet方法<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />再次问好。我查看了“分析”VB.NET示例:
C:\ Program Files \ SAS \ JMP \ 11 \ Samples \ Automation \ Visual Basic Samples \ Analysis .NET \ analysis.vb
然后,从ControlChart_Click()过程中,我提取了与IR图表相关的代码(见下文)。
代码运行成功...除了我添加的2行代码:
ccontrol2.LaunchSetIRChartParms(True,False,2)
ccontrol2.LaunchSetKSigmaAlphaH(True,False,False,3.0,1.0)
请告知正确的语法。谢谢!
“------------------------------------------------- ---------
'分析>控制图> IR>个人测量
“------------------------------------------------- ---------
Sub ControlChart()
昏暗的应用程序作为JMP.Application
Dim doc As JMP.Document
Dim dt作为JMP.DataTable
Dim ccontrol2作为JMP.ControlChart
'启动JMP
设置app = CreateObject(“JMP.Application”)
app.Visible = True
'访问文档并检索指向底层数据表的指针。
设置doc = app.OpenDocument(“C:\ Program Files \ SAS \ JMP \ 11 \ Samples \ Data \ Big Class.jmp”)
设置dt = doc.GetDataTable
'将数据表带到前台并使其成为活动表。
dt.Activate
'创建一种特定类型的分析对象(例如,ControlChart),
'用于指定列然后启动分析。
设置ccontrol2 = doc.CreateControlChart
'选择垂直轴上的图表列。
ccontrol2.LaunchAddProcess(“height”)
'选择其值标记水平轴的列。
ccontrol2.LaunchAddSampleLabel(“年龄”)
'选择按组处理的列。
ccontrol2.LaunchAddBy(“性”)
'从jmpControlChartConstants中选择您想要的图表类型(例如,IR)。
ccontrol2.LaunchSetChartType((JMP.jmpControlChartConstants.jmpControlChartIR))
'对于IR图表,设置Individual Measurement选项和KSigma参数。
ccontrol2.LaunchSetIRChartParms(True,False,2)
ccontrol2.LaunchSetKSigmaAlphaH(True,False,False,3.0,1.0)
'使用之前通过LaunchAdd___指定的列运行分析。
ccontrol2.Launch
结束子
Re:Excel VBA - IR控制图使用的LaunchSet方法谢谢,Brian。您对我的代码的测试有助于我指出正确的方向。
我读到了调用子例程的语法:
- 如果使用关键字“Call”,则必须将参数列表括在括号中。
- 如果省略关键字“调用”,则还必须省略参数列表周围的括号。
所以有两种正确的方法可以在VB中编写代码:
调用ccontrol2.LaunchSetIRChartParms(True,False,2)
调用ccontrol2.LaunchSetKSigmaAlphaH(True,False,False,3#,1#)
和
ccontrol2.LaunchSetIRChartParms True,False,2
ccontrol2.LaunchSetKSigmaAlphaH True,False,False,3#,1#
Re:Excel VBA - IR控制图使用的LaunchSet方法嗨JB,
我无法帮助你。 你上面提到的方法对我来说没问题。 你得到什么样的错误?
Brian Corcoran
JMP