首页 > 解决方案 > 如何设置一个不会返回 Nothing 的范围?

问题描述

早上好,

我有一个范围集来从受保护的工作表、关闭的工作簿、远程备份单元中的单元格中检索值。我想尽一切办法阻止它返回任何东西,但我就是做不到。

请参阅下面的示例。

Dim MyArray As Variant
Dim MyRange As Range

Set MyRange = ExecuteExcel4Macro("'" & "\\WDSENTINEL\Documents\HALTON PROJECTS\YEAR " & UserForm2.ComboBox1.Value & "\" & M + N & "\" & "[" & "Master.xlsm" & "]" & "Shipping" & "'!" & Range("D12").Address(True, True, -4150))
 ReDim Preserve MyArray(N)
  MyArray(N) = MyRange.Value2

然后,我意识到我之前为其他目的设置的所有范围,在过去几周一直运行良好的范围也开始返回 Nothing。

Excel 上是否存在配置/设置问题,设置为在这些范围内不返回任何内容?

标签: rangenothing

解决方案


推荐阅读