Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time error 1004 since upgrading from Excel 2003 to 2007.
At the risk of stating the obvious, there's something wrong with "olditer".
Since you didn't provide the code that sets it is there any chance it's not being set? And therefore has the value 0 (which is not between 1 and 32767)? -- Jim "PJ" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Excel 2007 VBA - Run-time error 1004 | Excel Programming | |||
Run time error 1004 When running in 2003 | Excel Discussion (Misc queries) | |||
Run time error 1004 generated in Excel (Office 2003) | Excel Programming | |||
Run-time error '1004' VBA Excel 2003 | Excel Programming |