Problem with xlCalculationAutomatic

spurs

Active Member
Joined
Oct 18, 2006
Messages
479
Office Version
  1. 2016
  2. 2013
  3. 2010
  4. 2007
  5. 2003 or older
Platform
  1. Windows
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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
bumping this as there was no response
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,071
Latest member
cdnMech

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
Back
Top