Access 2013/2016 does not support treeview control, giving error message "User defined type not defined"

yogeshgirnar picture yogeshgirnar · Jun 3, 2016 · Viewed 7.1k times · Source

I have a VBA project which runs perfectly upto windows 7 (both 32,64 bit) and upto office 2010. But when i try to run it on office 2013 or 2016. It does not load treeview control and gives error at:

Private SelectedNode As MSComctlLib.node

The things i have already tried are:

  1. Followed this post thoroughly http://thesmileycoder.com/treeview-working-in-access2013/

  2. Re-registered MSCOMCTL.OCX/MSCOMCT2.OCX several times on both SYSTEM32 and SYSWOW64 folders.

Any help is appriciated!

Answer

ThunderFrame picture ThunderFrame · Jun 3, 2016

Thanks for clarifying that you're using Office 64-bit.

You should see this article

Specifically the section:

Most things included in the 32-bit version of Office are included in the 64-bit version of Office.

The following are some things not in the 64-bit version of Office.

ActiveX controls library, ComCtl - This library contains ActiveX controls used to build solutions. It is most commonly used in Microsoft Access, Microsoft Excel, and Microsoft Word.

SharePoint List control The list view in SharePoint Technology isn’t available in 64-bit version of Office.

Followed by:

ActiveX controls library, ComCtl - Any solutions using these controls don’t work. No good alternatives are available for some of these controls.

EDIT And this page for 2010 spells it out in more detail:

Native 64-bit processes in Office 2010 cannot load 32-bit binaries. This includes the common controls of MSComCtl (TabStrip, Toolbar, StatusBar, ProgressBar, TreeView, ListViews, ImageList, Slider, ImageComboBox) and the controls of MSComCt2 (Animation, UpDown, MonthView, DateTimePicker, FlatScrollBar).These controls were installed by previous versions of Microsoft Office and are installed by 32-bit Office 2010. An alternative must be found for existing Microsoft Office VBA solutions that utilize these controls when the code is migrated to 64-bit Office 2010. 64-bit Office 2010 does not provide 64-bit versions of the Common Controls.