Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Application.Calculation=xlCalculationManual causing run time error?

Two guesses:

Are you two using different versions of excel?

xlcalculationmanual was added in xl97 (IIRC)

But you could use xlmanual (for backwards compatibility).

from the VBE immediate window:

?xlmanual
-4135
?xlcalculationmanual
-4135

so both mean the same thing

=======
Is this code in an addin?

Maybe you get the error because there is no activeworkbook????

If ActiveWorkbook Is Nothing Then
'do nothing
Else
Application.Calculation = xlCalculationManual
End If

john wrote:

When running some of my code which includes the ubiquitous statement

Application.Calculation=xlCalculationManual

a colleauge of mine gets Run Time Error 1004.

Does anyone know how to correct this (aside from sandwiching the statement
in On Error Resume Next and On Error Goto 0)?

tks, john


--

Dave Peterson

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Application.Calculation=xlCalculationManual causing run time error?

no luck - we're both using Excel 97 and the code isn't in an addin

"Dave Peterson" wrote in message
...
Two guesses:

Are you two using different versions of excel?

xlcalculationmanual was added in xl97 (IIRC)

But you could use xlmanual (for backwards compatibility).

from the VBE immediate window:

?xlmanual
-4135
?xlcalculationmanual
-4135

so both mean the same thing

=======
Is this code in an addin?

Maybe you get the error because there is no activeworkbook????

If ActiveWorkbook Is Nothing Then
'do nothing
Else
Application.Calculation = xlCalculationManual
End If

john wrote:

When running some of my code which includes the ubiquitous statement

Application.Calculation=xlCalculationManual

a colleauge of mine gets Run Time Error 1004.

Does anyone know how to correct this (aside from sandwiching the

statement
in On Error Resume Next and On Error Goto 0)?

tks, john


--

Dave Peterson



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Application.Calculation=xlCalculationManual causing run time error?

John,

Here's some code I use in 97. It is triggered from a toolbar button and
toggles on/off.

Private Sub Calc_On_Off()
'
' Toggle between CalcOn & CalcOff Macro
' Macro recorded 12/15/99 by Sbell
'
On Error Resume Next
Select Case Application.Calculation
Case xlManual
Application.Calculation = xlAutomatic
Application.CommandBars("SB1").Controls(7).Caption = " Calc Off "
Case xlAutomatic
Application.Calculation = xlManual
Application.CommandBars("SB1").Controls(7).Caption = " Calc On "
End Select


With Application
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False

End Sub

--
sb
"john" wrote in message
...
no luck - we're both using Excel 97 and the code isn't in an addin

"Dave Peterson" wrote in message
...
Two guesses:

Are you two using different versions of excel?

xlcalculationmanual was added in xl97 (IIRC)

But you could use xlmanual (for backwards compatibility).

from the VBE immediate window:

?xlmanual
-4135
?xlcalculationmanual
-4135

so both mean the same thing

=======
Is this code in an addin?

Maybe you get the error because there is no activeworkbook????

If ActiveWorkbook Is Nothing Then
'do nothing
Else
Application.Calculation = xlCalculationManual
End If

john wrote:

When running some of my code which includes the ubiquitous statement

Application.Calculation=xlCalculationManual

a colleauge of mine gets Run Time Error 1004.

Does anyone know how to correct this (aside from sandwiching the

statement
in On Error Resume Next and On Error Goto 0)?

tks, john


--

Dave Peterson





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Application.Calculation=xlCalculationManual causing run time error?

Sorry, I don't have another guess.

john wrote:

no luck - we're both using Excel 97 and the code isn't in an addin

"Dave Peterson" wrote in message
...
Two guesses:

Are you two using different versions of excel?

xlcalculationmanual was added in xl97 (IIRC)

But you could use xlmanual (for backwards compatibility).

from the VBE immediate window:

?xlmanual
-4135
?xlcalculationmanual
-4135

so both mean the same thing

=======
Is this code in an addin?

Maybe you get the error because there is no activeworkbook????

If ActiveWorkbook Is Nothing Then
'do nothing
Else
Application.Calculation = xlCalculationManual
End If

john wrote:

When running some of my code which includes the ubiquitous statement

Application.Calculation=xlCalculationManual

a colleauge of mine gets Run Time Error 1004.

Does anyone know how to correct this (aside from sandwiching the

statement
in On Error Resume Next and On Error Goto 0)?

tks, john


--

Dave Peterson


--

Dave Peterson

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
Formula causing run-time error in Excel Programming cherman Excel Worksheet Functions 2 March 15th 10 10:59 PM
Run-time error '-2146233079 (80131509)' in the Excel Application Sandeep New Users to Excel 1 July 27th 07 01:52 PM
Run-time error '-2146233079 (80131509)' in the Excel Application Sandeep Excel Discussion (Misc queries) 0 July 25th 07 07:14 PM
I got this problem run-time error 1004 application defined ... Davide Blau Excel Discussion (Misc queries) 2 July 10th 06 09:27 PM
Using Application.quit is causing my macro to run and print twice... Kathy[_4_] Excel Programming 0 July 31st 03 07:12 PM


All times are GMT +1. The time now is 05:37 AM.

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

About Us

"It's about Microsoft Excel"