vba定义的全局变量,在一个模块中初始化完以后,到另一个模块以后就全变成0了,这个是为什么啊
PublicEEP_Original_eepName()AsStringPublicEEP_Original_eepSize()AsStringPublicEEP_Ori...
Public EEP_Original_eepName() As String
Public EEP_Original_eepSize() As String
Public EEP_Original_eepValue() As String
Public EEP_Original_eepHexValue() As String
Public EEP_Changed_eepName() As String
Public EEP_Changed_eepSize() As String
Public EEP_Changed_eepValue() As String
Public EEP_Changed_eepHexValue() As String
Public EEP_Aef_eepName() As String
Public EEP_Aef_eepValue() As String
Public Function MPF_StoreOriginalEEP()
Dim idx As Integer
Dim StrStartAddr As String
Dim StrEndAddr As String
StrStartAddr = ThisWorkbook.Worksheets("EEPROM Configuration").Cells(5, "B")
StrEndAddr = ThisWorkbook.Worksheets("EEPROM Configuration").Cells(6, "B")
MPP_FixedEepSize = Val("&H" + StrStartAddr) - Val("&H" + StrEndAddr) + FixedCalibrationStartIndex
ReDim EEP_Original_eepName(MPP_FixedEepSize)
ReDim EEP_Original_eepSize(MPP_FixedEepSize)
ReDim EEP_Original_eepValue(MPP_FixedEepSize)
ReDim EEP_Original_eepHexValue(MPP_FixedEepSize)
For idx = FixedCalibrationStartIndex To MPP_FixedEepSize Step 1
EEP_Original_eepName(idx) = ThisWorkbook.Sheets("Fixed Calibration").Cells(idx, "B")
EEP_Original_eepSize(idx) = ThisWorkbook.Sheets("Fixed Calibration").Cells(idx, "C")
EEP_Original_eepValue(idx) = ThisWorkbook.Sheets("Fixed Calibration").Cells(idx, "E")
EEP_Original_eepHexValue(idx) = ThisWorkbook.Sheets("Fixed Calibration").Cells(idx, "F")
这里提示下标越界了,因为没有这个数组,但是在初始化的时候我调试明明看到都是有值的,怎么到另个一模块就没了呢? 展开
Public EEP_Original_eepSize() As String
Public EEP_Original_eepValue() As String
Public EEP_Original_eepHexValue() As String
Public EEP_Changed_eepName() As String
Public EEP_Changed_eepSize() As String
Public EEP_Changed_eepValue() As String
Public EEP_Changed_eepHexValue() As String
Public EEP_Aef_eepName() As String
Public EEP_Aef_eepValue() As String
Public Function MPF_StoreOriginalEEP()
Dim idx As Integer
Dim StrStartAddr As String
Dim StrEndAddr As String
StrStartAddr = ThisWorkbook.Worksheets("EEPROM Configuration").Cells(5, "B")
StrEndAddr = ThisWorkbook.Worksheets("EEPROM Configuration").Cells(6, "B")
MPP_FixedEepSize = Val("&H" + StrStartAddr) - Val("&H" + StrEndAddr) + FixedCalibrationStartIndex
ReDim EEP_Original_eepName(MPP_FixedEepSize)
ReDim EEP_Original_eepSize(MPP_FixedEepSize)
ReDim EEP_Original_eepValue(MPP_FixedEepSize)
ReDim EEP_Original_eepHexValue(MPP_FixedEepSize)
For idx = FixedCalibrationStartIndex To MPP_FixedEepSize Step 1
EEP_Original_eepName(idx) = ThisWorkbook.Sheets("Fixed Calibration").Cells(idx, "B")
EEP_Original_eepSize(idx) = ThisWorkbook.Sheets("Fixed Calibration").Cells(idx, "C")
EEP_Original_eepValue(idx) = ThisWorkbook.Sheets("Fixed Calibration").Cells(idx, "E")
EEP_Original_eepHexValue(idx) = ThisWorkbook.Sheets("Fixed Calibration").Cells(idx, "F")
这里提示下标越界了,因为没有这个数组,但是在初始化的时候我调试明明看到都是有值的,怎么到另个一模块就没了呢? 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励20(财富值+成长值)
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询