Pages

Thursday, June 9, 2011

Excel 2007 - Error 800A9C68

If you are using Excel 2007 or higher version and get the said error while importing data into Tally using UDIMagic, then it is likely due to Macros.

Solution:-
In Excel 2007, the default setting for Recalculation of formulas is AUTOMATIC. We need to change it to MANUAL initially before making changes in the Excel sheet at run-time and the reset it to the Automatic at the end.

The following code is used to set the calculation to Manual :-
'Stop Recalculation
Dim xlCalc As XlCalculation
xlCalc = Application.Calculation
Application.Calculation = xlCalculationManual
On Error GoTo CalcBack

The following code is used to reset the calculation setting to Automatic :-
'Recalculate
Application.Calculation = xlCalculationAutomatic
Exit Sub

CalcBack:
Application.Calculation = xlCalculationAutomatic