PC Review


Reply
Thread Tools Rate Thread

Run-time error 1004 since upgrading from Excel 2003 to 2007.

 
 
PJ
Guest
Posts: n/a
 
      23rd Jul 2008
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 With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      23rd Jul 2008
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" <(E-Mail Removed)> wrote in message
news:5E0FD429-645A-4433-A899-(E-Mail Removed)...
>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 1004 opening workbook 1004 WembleyBear Microsoft Excel Programming 2 30th Nov 2009 02:33 PM
vba error 1004 when upgrading from excel 2000 to 2003 =?Utf-8?B?TWFyayBIb2xjb21i?= Microsoft Excel Crashes 3 3rd Jun 2005 05:49 PM
sub totals don't work properly since upgrading excel 2003 =?Utf-8?B?YmVhY2hncmFuZHBh?= Microsoft Excel Worksheet Functions 1 4th May 2005 06:21 PM
no send button on microsoft outlook 2003 since upgrading =?Utf-8?B?VmluY2U=?= Microsoft Outlook Discussion 1 20th Nov 2004 12:23 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Microsoft Excel Programming 2 15th Jun 2004 03:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:57 PM.