VBA to save without calculating

Kappy

Board Regular
Joined
Jun 26, 2009
Messages
58
hi all,

Sometimes while working in large files I like to save the file without it calculating..

Currently I just press save, then escape, and select the option to save without calculating

I'd like to write a quick macro that can do this but am completely stumped as to how..

any ideas?

thanks
 
Try this...

Code:
[color=darkblue]Sub[/color] Save_without_Calculating()
    Application.CalculateBeforeSave = [color=darkblue]False[/color]
    ThisWorkbook.Save
    Application.CalculateBeforeSave = [color=darkblue]True[/color]
[color=darkblue]End[/color] [color=darkblue]Sub[/color]
 
Upvote 0
I had the same issue. I added this to the workbook and it works great:

Code:
Option Explicit

'when you open the workbook, switches calculation to manual

Private Sub Workbook_Open()     
     Application.Calculation = xlManual
End Sub


'when you click save, turn off Calculate Before Save
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) 
     Application.CalculateBeforeSave = False
End Sub

'after the save, switch back to normal
Private Sub Workbook_AfterSave(ByVal Success As Boolean)
     Application.CalculateBeforeSave = True
End Sub
 
Upvote 0

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