Manual Calculation using VBA

Hi guys this is my problem:

I've wrote a VBA appplication in Excel97 and I need this application to activate manual Calculation. I do it with this:

Application.Calculation = xlCalculationManual

Then, I would like to add a button, a real one using a "command button". But when the click event of this button executes the application, excel abort it in the manual calculation activation instruction (Application.Calculation = xlCalculationManual)

Why? I don't know. I can assign a Macro to an Autoform shape and it works OK. Executing the macro with the "Execute Macro" button in the VB ToolBar works just fine too.

Any ideas?
LVL 2
nfernandAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
tureConnect With a Mentor Commented:
nfernand,

This is a bit buggy. Try one of the following to avoid this problem:

* Set the button's 'TakeFocusOnClick' to False

* Use this as the first line in the procedure called by the button:
AvtiveCell.Activate

Any better?

Ture Magnusson
Karlstad, Sweden
0
 
nfernandAuthor Commented:
Thank you man... the 'TakeFocusOnClick' worked OK.
0
 
tureCommented:
nfernand,

I'm glad that I could help you. Thanks for the points!

/Ture
0
All Courses

From novice to tech pro — start learning today.