Fix Excel VBA Compile error

After EtaTrader/KiteNet update, if you get one or more of the below ERRORS while opening your existing workbooks, then you have to recompile your Excel/Workbook/VBA to fix this.

  • Can’t find project or library
  • ActiveX component can’t create object
  • Automation Server Can’t Create Object
  • class does not support Automation or does not support expected interface
    Method or data member not found
  • User defined-type not defined
  • Wrong number of arguments or invalid proprty assignment.

Close the Excel/Workbook WITHOUT saving if opened and backup the workbook.

OPEN YOUR WORKBOOK IN SAFE MODE

Goto EtaTrader
|
Menu
|
Tools
|
Click ‘Excel SafeMode’

Select the required ‘Excel Workbook’
Click ‘Open’
(This will open the excel workbook in Safe Mode i.e. Macros Disabled)

OPEN VBA EDITOR AND EDIT CODE

Right Click on ANY Sheet Name
And
Click ‘View Code’
(This will open Excel VBA Editor)

In the ‘Project Explorer’ (Left Side)
Expand the ‘Modules’ tree
Double Click on ANY Module
Goto the bottom of the VBA Code
Type ”’ (Three Single Quote) and Press Enter

SAVE AND RE-COMPILE

Save the VBA Code by
Clicking on the ‘Save’ icon

Goto Menu
|
Debug
|
Compile VBA Project

CLOSE VBA EDITOR AND SAVE WORKBOOK

Close the VBA Editor
By Click on the Close Button

Save the Workbook by Clicking on the Save Icon
Close the Workbook By Click on the Close Button

Now, you can open this workbook normally.
If the recompile is success then it won’t throw any error.
(Same way recompile all the workbook once)