View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PJ PJ is offline
external usenet poster
 
Posts: 112
Default Run-time error 1004 since upgrading from Excel 2003 to 2007.

I have a workbook with many, many macros. Since I upgraded to Excel 2007, I
am receiving the following error message with one of my macros:

"Run-time error 1004. The number must be between 1 and 32767. Try again by
entering a number in this range"

Here is a sample of the code. The statement "Application.MaxIterations =
olditer" is the line that is being highliged by Visual Basic.

skipcalc4:
If Worksheets("Workarea").Cells(43, 7) < 0 Then
Worksheets("NPV Model Workarea").Cells(43, 7) = 0
End If

Application.MaxIterations = olditer
Application.MaxChange = oldchange

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Worksheets("Workarea").Visible = False

End Sub