Microsoft KB Archive/80108

{|
 * width="100%"|

Excel: OFFSET Function Returns #VALUE When File Is Closed

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 3.0, 4.0, 4.0a, 5.0, 5.0c
 * Microsoft Excel for Windows NT, version 5.0
 * Microsoft Excel for OS/2, version 3.0
 * Microsoft Excel for the Macintosh, versions 3.x, 4.x, 5.0, 5.0a

-

SYMPTOMS
In Microsoft Excel, the OFFSET function returns a reference value offset by a specified number of rows and columns from a given reference. If this reference refers to an external sheet, a #VALUE! error will be returned if the sheet is closed. This error will occur both in worksheets and in Microsoft Excel 4.0 macro sheets.

WORKAROUND
To return the correct result, use the appropriate procedure below.

Worksheet
Open the sheet that the reference is referring to.

Microsoft Excel 4.0 Macro Sheet
Open the sheet that the reference is referring to and run the macro again.