Problem with xlCalculationAutomatic

spurs

Active Member
Joined
Oct 18, 2006
Messages
451
I have the following abbreviated code in a worksheet
the intent is that when sub Units_mm_to_in2() is run, the worksheet changes from a metric version to an inch verseion

It as working a few years ago but today it is not functioning. Something gets stuck on the last line:

Application.Calculation = xlCalculationAutomatic ' turns on automatic spreadsheet calculation and does a calc

and excel closes and restarts
I cant seem to figure out why it is doing this now. Possible driver issue?

Any insight would be appreciated


VBA Code:
Option Private Module

' the following function is used to select data from 2 different worksheets
' and select which worksheet is active - see D2 sheet for where it is used
Public Function IsVisible(r As Range)
  Application.Volatile
  IsVisible = r.Worksheet.Visible = xlSheetVisible
End Function

Sub Units_mm_to_in2()

' This subroutine sets the formatting of the worksheet from mm to inches
' The worksheet "holder needs to be set up to look at the "Main in" worksheet for its inputs
Dim A As String
Application.ScreenUpdating = False
A = ActiveCell.Address(0, 0)

Application.Calculation = xlCalculationManual    ' turns off autmatic spreadsheet calculation
   
Sheets("Test Geometry (in)").Range("B2") = Sheets("Test Geometry (mm)").Range("B2")     ' customer
Sheets("Test Geometry").Range("B2") = "='Test Geometry (in)'!B2"
 
Sheets("Test Geometry (in)").Range("G52") = Sheets("Test Geometry (mm)").Range("G52") / 25.4    ' Selected Ball Dia test gear
Sheets("Test Geometry").Range("G52") = "='Test Geometry (in)'!G52 * 25.4"

Sheets("D").Range("E21") = 2
Sheets("D").Range("D4") = 25.4

Sheets("DF Calcs").Range("B42") = "in"
Sheets("CD-TR Chart").Range("F4:K9").NumberFormat = "0.0000"
Sheets("Polar Center Distance Chart").Range("F4:K9").NumberFormat = "0.0000"

Sheets("Test Geometry (in)").Visible = True
Sheets("Test Geometry (in)").Activate
Range(A).Select
Sheets("Test Geometry (mm)").Visible = False

Application.Calculation = xlCalculationAutomatic   ' turns on automatic spreadsheet calculation and does a calc

End Sub
 
Last edited by a moderator:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,175,527
Messages
5,897,942
Members
434,688
Latest member
vi28

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top