[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Creating ActiveX control at run-time

Posted on 1998-08-05
6
Medium Priority
?
187 Views
Last Modified: 2010-08-05
I have no experience with VB. I need to create ActiveX control at run-time. I tried to use GetObject and CreateObject passing ProgID. Object is created successfully. But then I cannot call any of its methods or set any of its properties. I even can't show it if I set Visible control window property to true. I get run-time error "Object doesn't support this method".

Below is my piece of code

Dim objChart As Object
Set objChart = GetObject("", "mschartlib.mschart")
objChart.Visible = True
0
Comment
Question by:galkin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Expert Comment

by:ndb
ID: 1467937
You should try to make a new object:
Dim objChart As New Object
0
 
LVL 7

Author Comment

by:galkin
ID: 1467938
I tried your solution and I get compiler error "Expected: identifier"
0
 
LVL 2

Expert Comment

by:percosolator
ID: 1467939
got the doesn't support this property or method.

why do you need to create it at run-time?  Why not use early binding?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Author Comment

by:galkin
ID: 1467940
I try to change control window properties, for instance Visible. In this case I get error that property or method is not supported bu the control. If I call really control method or set proprty I get OLE run-time error.
I do need to create ActiveX control at run-time. I guessed it is very basic simple task, in C++ I would do it in 10 seconds.
0
 

Accepted Solution

by:
chitnis earned 200 total points
ID: 1467941
Activex controls cannot be created at runtime.You have to load at least one controlmyocx(0) on the form at design time,Set its index property to 0 and then create a control array by saying
  load myocx(1)
0
 
LVL 7

Author Comment

by:galkin
ID: 1467942
Could you give me an example. I am absolutely not familiar with VB syntax.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question