Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default turning off automatic calculation when loading VBA add-in

I want to turn of automatic calculation in Excel from my add-in
and have put the following code in the ThisWorkbook module.

Private Sub Workbook_Open()

Application.Calculation = xlCalculationAutomatic
End Sub


When starting Excel and there by loading the add-in I get the following
error:

Method 'Calculation' of object '_Application' failed

I seems to be the problem?

Lars

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default turning off automatic calculation when loading VBA add-in

Found a solution

ThisWorkbook.Activate
Application.Calculation = xlCalculationManual

because:
You need to have a workbook active before you can set the Calculation
property and although it seems counterintuitive, you can "activate"
your
add-in workbook to serve this purpose even though it's not visible.
You need to have a workbook active before you can set the Calculation
property and although it seems counterintuitive, you can "activate"
your
add-in workbook to serve this purpose even though it's not visible.

Source:http://www.excelforum.com/archive/in.../t-260962.html

Thanks
Lars

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
turning off automatic Help childofthe1980s Excel Discussion (Misc queries) 0 February 7th 09 04:55 PM
Turning off automatic mailto: [email protected] New Users to Excel 2 June 14th 07 05:05 PM
Turning off all Automatic Formatting in Excel 2003 Adam M Excel Discussion (Misc queries) 0 November 4th 05 01:07 PM
Turning off automatic calculation when opening a CSV file Will Excel Programming 2 September 20th 05 10:39 AM
Turning Of Calculation Joe Gieder[_2_] Excel Programming 1 September 8th 04 07:51 PM


All times are GMT +1. The time now is 06:38 PM.

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"