For the past few months, I have been developing a VBA software that uses the ActiveX Treeview control. I had no issues with using the control until today when suddenly I get the following error:
You don't have the license required to use this ActiveX control.
You tried to open a form containing an OLE object or an ActiveX control or you tried to create an ActiveX control. To obtain the appropriate license, contact the company that provides the licensed OLE object or ActiveX control.
How does one go about getting and using the license for these controls?
This is a known bug caused by an update of the CommonControl control.
It will be fixed as noted here with an upcoming update.
Related
I want to be able to drag and drop files into a custom user form in my Outlook VBA macro. My searching has come up with many solutions all requiring "Microsoft Windows Common Controls 6.0" which is not available as a reference on my network.
Is there a way to do it without this reference library?
Thanks for the responses - I actually managed to reference 'Microsoft Windows Common Controls 6.0" by adding the reference directly to the MSCOMCTL.OSX file which was already installed.
I am currently working on an PowerPoint Addin and I am currently finishing the Ribbon. I'd like to create a control to change the size of objects that looks similar to the inbuild button "ShapeWidth" and "ShapeHeight":
However, I couldn't find the correct control type and hence I built the below by myself using an editbox and buttons. Although it's working I find the other style way cleaner but I haven't found the correct type.
Not all Ribbon X (Office Fluent UI) control types that Microsoft uses in its Office applications are made available to third-party developers. This, I'm afraid, falls into that category.
You should probably be able to get the image, at least, by specifying the idMso for the built-in control.
I am in the process of developing an ActiveX control for embedding in Rockwell Automation's Factory Talk View. (See ActiveX DLL Error: Solved to see how great a start I got off to!)
At the moment I have an ActiveX control that seems to embed into the host system OK, but is not fully integrated into the VBA process. I believe that this is because I have not implemented some specific COM interface that is required, but I have no documentation as to what that is. I do know that standard MS controls like the Microsoft Forms 2.0 controls do implement the required interface and fully integrate.
The key functionality I am missing relates to a property that I need to set in order for my VBA code to actually see the ActiveX object. This property can be seen when opening the property panel for any activeX control placed on a Factory Talk screen, but NOT when looking at the properties of ActiveX controls embedded in (for example) Excel. Thus I am probably trying to chase down some custom Rockwell implementation. I am hoping that SO might be able to give me some aid into how to track down what I want based on recognizing the functionality it implements.
Now to the actual property. In Factory Talk the property is called "ExposeToVBA", and has a type "long". You have a choice of 3 values selected from a drop down list:
Not Exposed - When set to this, the controls name is not even visible to VBA code
Type Info Extension - Not sure what this does
VBA Control - VBA code can see and interact with the control.
When I select anything other than "Not Exposed" for my control, I get a warning dialog box with no text on it. For other controls I need to set it to "VBA Control" in order to interact with it in the VBA code (d'oh)
I suspect that the value of this property is translated into some calls to an ActiveX interface on the target control.
The Question
What I want to do is identify what interfaces something like a "Forms 2.0 Label" implements that would match the above functionality. And also perhaps how I could translate this into my C# based control (based on C# ActiveX control (CSActiveX))
I know its a long shot, but I'd appreciate any and all suggestions
This became moot when I found a canned Active-x control that had the functionality that I needed.
FWIW This is what I believe that I used: DMGraph
In a VBA project, you can create a UserForm and add controls to it using the toolbox window. By default, the toolbox window contains the simple form controls such as Label, TextBox, ListBox, etc.
You can add additional controls if they're installed on your machine: right-clicking "additional controls" on the toolbox shows a whole screed of controls. However, this does not give any indication of where they came from.
I'm interested to know what controls are guaranteed to be available on a machine that has Office 2007 installed. Is it just the standard ones, or are some of the "additional controls" also guaranteed to be available (either because they come with Office 2007, or because they exist on all the versions of Windows that Office 2007 will run on)?
For example, I'm surprised that there's no treeview control even in Office 2007. In my "additional controls" list I see the "Microsoft TreeView Control v6", but I don't know whether I can rely on that being present for all my Office 2007 users.
The controls you see are part of FM20.DLL; which is part of the Office Install.
You can see that they are all part of the same DLL by looking in the "Location" portion of the "Additional Controls" box.
AFAIK, those are the only controls guaranteed available with most Office installations.
So that being said, let's see what can be done specifically for each control you ask about in your comments:
"grid" capable list
hierarchical tree view
calendar control
The Grid
It's going to come down to your requirements, but you may be able to get away with using a listbox. The listbox in VBA has a few of properties that make will make it Grid-like.
For example, let's say a worksheet in Excel looks like this:
ID001 Value 1 Description 1
ID002 Value 2 Description 2
ID003 Value 3 Description 3
The listbox supports multiple columns, so you can make these values show up by setting the listbox property ColumnCount to 3 and writing the following code:
Me.ListBox1.ColumnWidths = "50;100;200"
Me.ListBox1.RowSource = Sheet1.Range("A1:C3").Address
You will get something like this:
Want to hide a column? No problem, change the width of the ColumnWidths property to zero for the column to hide:
Me.ListBox1.ColumnWidths = "50;0;200" 'Hide column 2
What good is a grid if you can't select things from it, right?
On the listbox, change the ListStyle property to frmListStyleOption and then change MultiSelect to frmMultiSelect.
That will give you a listbox that looks more like a grid:
Calendar
08/17/2012 UPDATE:
Read this post. One of the guys who answered created his own calendar control.
A calendar control exists for Office (mscal.ocx):
However, the right conditions must be met:
Access must be installed on the clients machine
The Office version cannot be Office 2010 as it was removed with this version (See Features removed from Microsoft Access)
You can still get the calendar control to work with 2010 and/or non-Access Office installations, but it takes additional steps on the client's machine.
Download mscal.ocx
Extract it to windows/system32 directory
Register it
TreeView
If it's acceptable for you clients to install some EXEs, you could have them install Microsoft Visual Basic 6.0 Common Controls. That will give you the TreeView control.
I would be willing to bet that most machines (particularly older ones on Windows XP) already have these OCXs installed; thus the installation may not be necessary.
The biggest problem is that you're deploying OCXs on client machines and that gets frustrating from a support standpoint.
I'm trying to add DatePicker VBA control in an PowerPoint 2007 slide. But I couldn't find any such control.
I have added Microsoft Office 12.0 Object Library as well as Microsoft Excel and Powerpoint Object Library, but still I couldn't find any control related to DatePicker.
I'd love if someone can direct me to some article or documentation, tutorial to add it.
The control isn't included with Office/VBA. If it's installed on your PC, the answer posted by Jean-François Corbett will get you there, but your code won't work on other PCs unless they also have the needed control installed.
Have a look here:
http://www.excelbanter.com/showthread.php?t=241456
Is this what you want?
Developer > Controls > More controls... (the hammer-and-wrench icon) > Microsoft MonthView Control