3

I would like to use late binding to use the following reference :

Name : "Microsoft Windows Common Controls 6.0 (SP6)"

Filepath : "C:\Windows\System32\MSCOMCTL.OCX"

GUID : "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}"

I understood thanks to this topic the difference between early and late binding:

This is early binding: Dim olApp As Outlook.Application Set olApp = New Outlook.Application

And this is late binding: Dim olApp As Object Set olApp = CreateObject("Outlook.Application")

However, I do not know how to find my object name (see bold quoted text above). Every example on the internet uses Powerpoint or Outlook.application.

Any help? Thanks

Jeanjean
  • 723
  • 2
  • 12
  • 22
  • What kind of object are you trying to create? IIRC, the DLL you refer to has several. – steenbergh Mar 23 '18 at 12:37
  • I generate a UF with a Treeview in order to drag and drop files. Private Sub TreeView_Drop_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) – Jeanjean Mar 23 '18 at 12:39
  • The progid would be `MSComctlLib.XXX`. But if you have a TreeView on a userform you are already early bound, so why do you need late binding? – Alex K. Mar 23 '18 at 12:46
  • 1
    I'd like to share my file and want to optimize compatibility and make sure the object will load in any case. I also want to avoid clicks from users. Thus, I can't use .Addfromfile (need to enable access to VBA object model with many clicks). Am I doing it wrong? – Jeanjean Mar 23 '18 at 12:52
  • 2
    Well if you have a form with a treeview then that library must exist, if it doesn't it wont work at all. In terms of compatibility it's worth noting that it won't work at all with 64 bit office. – Alex K. Mar 23 '18 at 12:58
  • 1
    I created my file by adding the reference manually. I would like to be sure this reference is well added and available for everybody who will use this .xslx file in the future. That is why I'd like to add it with late binding (just in case). Maybe I didn't understand what late binding is all about – Jeanjean Mar 23 '18 at 13:01
  • @AlexK. The 64-bit version of mscomctl.ocx is has been available for a few months and is now distributed with Office 365 updates. – Cindy Meister Mar 23 '18 at 18:42

0 Answers0