Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Compilation 子行给出编译错误:未定义变量_Compilation - Fatal编程技术网

Compilation 子行给出编译错误:未定义变量

Compilation 子行给出编译错误:未定义变量,compilation,Compilation,在尝试运行代码时,我得到一个错误“compile error:variable not defined”,它突出显示了我的子行。这是代码供参考 Sub RI_Processing() Dim i As Single Dim Output() As Single 'Define this dynamic array for the solver output Process the DMSO data For i = 1 To 45 Step 1 Work

在尝试运行代码时,我得到一个错误
“compile error:variable not defined”
,它突出显示了我的子行。这是代码供参考

Sub RI_Processing()
    Dim i As Single
    Dim Output() As Single 'Define this dynamic array for the solver output

Process the DMSO data
    For i = 1 To 45 Step 1
        Workbooks("Calibration Range 1 Normalized Profiles.xlsx").Activate
        RawData.Range("C10:C649") = Sheet1.Columns("i").Values
        SolverOk SetCell:="$E$7", MaxMinVal:=2, ValueOf:=0, ByChange:="$B$2:$B$4", _
        Engine:=1, EngineDesc:="GRG Nonlinear"
        SolverSolve
        Workbooks("Simulated Fresnel Function.xlsx").Activate
        Output(i, 1) = Sheet1.Range("B4").Values

    Next i

    i = 0

    ' Process the NaCl Data
    For i = 1 To 102 Step 1
        Workbooks("Calibration Range 1 Normalized Profiles.xlsx").Activate
        RawData.Range("C10:C649") = Sheet2.Columns("i").Values
        SolverOk SetCell:="$E$7", MaxMinVal:=2, ValueOf:=0, ByChange:="$B$2:$B$4", _
        Engine:=1, EngineDesc:="GRG Nonlinear"
        SolverSolve
        Workbooks("Simulated Fresnel Function.xlsx").Activate
        Output(i, 2) = Sheet1.Range("B4").Values

    Next i

    i = 0

    ' Process the Sucrose data
    For i = 1 To 72 Step 1
        Workbooks("Calibration Range 1 Normalized Profiles.xlsx").Activate
        RawData.Range("C10:C649") = Sheet3.Columns("i").Values 'Copies the data of all 'i' columns to raw data for solver
        SolverOk SetCell:="$E$7", MaxMinVal:=2, ValueOf:=0, ByChange:="$B$2:$B$4", _
        Engine:=1, EngineDesc:="GRG Nonlinear"
        SolverSolve 'Run solver
        Workbooks("Simulated Fresnel Function.xlsx").Activate
        Output(i, 3) = Sheet1.Range("B4").Values 'Put solver output to the matrix 'output' in the appropriate columns

    Next i

End Sub