Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Excel 2007 VBA - Run-time error 1004 SG Excel Programming 10 January 28th 08 03:48 PM
Run time error 1004 When running in 2003 Lakshman Excel Discussion (Misc queries) 10 January 17th 07 06:06 PM
Run time error 1004 generated in Excel (Office 2003) [email protected] Excel Programming 1 September 5th 06 02:43 PM
Run-time error '1004' VBA Excel 2003 pltang Excel Programming 1 July 19th 06 11:15 PM


All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"