ActiveX Collections Via VBA


I have a workbook which is a reasonably standard financial model (PL, BS, CF, etc). I have a control worksheet with a number of AcitveX controls (Command Buttons, Toggle Buttons and Combo Boxes) that drive the rest of the model (e.g., depreciation methods, trade terms, etc). When the workbook opens I want to fill the lists of the various ComboBoxes, but I can't work out how to access JUST THE COMBOBOXES as a defined collection (e.g., MyWkSht.ComboBoxes[Index] or some such), or as a sub-type of a meta-collection (e.g., MyWkSht.Controls with Type="ComboBox"), without referring to them directly by name (e.g., MyWkSht.MyComboBox). The ComboBoxes are NOT on a UserForm, but are embedded on the sheet as OLE objects. I really don't want to have to hard-code the combobox names in directly, because I may need to add/remove them as the model develops - and anyway it's just WAY inelegant.

View Answers
Very similar questions


Enhance Existing Control www.codeguru.com

Hi there:Can someone tell me how to enhance an existing ActiveX control such as MS Agent that consists of collections. In the ActiveX Control Interface Wizard, it will not show any properties, methods and events for any collections such as ballons, animationNames etc.Because of the program i am using, i need an activeX that does not contain any colections, so i decide to enhance agent by making my own activeX but with no collections, instead i will to expose all the collections properties, methods and events in my activeX.Any help or any insights will be much appreciated.Cecil Medical DoctorCBT/Web CBT ConsultantNetwork SupporterMultimedia DeveloperVB and VBA SpecalistCompany URL: Http://webcbt.chToolbook Developers Network URL: Http://webcbt.ch

ActiveX Controls On Worksheet - Fmbackstyle www.mrexcel.com

I have problems wit setting some ActiveX controls properties. If I place ActiveX on worksheet manually, it is diferrent object, then If I place it by VBA code. I, am not able to open properities window for controls created by VBA. When I open properties window for ActiveX created manually, there is property fmbackstyle. If I am trying to set this property by VBA for controls created by VBA, result is error.

How To Extract The Key Of An Item In A Collection www.codeguru.com

Could someone tell me how to extract the key of an item in a collection?Dim mcol as new Collectionmcol.Add "item1", "key1"Then I passed this collection to an ActiveX DLL.The ActiveX DLL doesn't know the keys used for each item the collection. I know I can use an index like : debug.print col(index). But is there a way to extract the keys used for each item in the collection instead of using an index?Thank you

VBA Installation www.vbforums.com

Hi,I have a ActiveX object that can be called from VBA and I have a VBA program that utilises it. I want to try and distribute the ActiveX and the VBA program as an add on, I know how to create a Command Bar in Microsoft Office, I was wondering if anyone knows how to add VBA programs and add references to ActiveX Objects from code, so I can write an installation package.Thanks in advanceMechEngCoder

My Combobox Closes In The First Use www.xtremevbtalk.com

Hello,I am writing VBA into a SCADA system. I connect combobox into VBA via activeX since VBA of the SCADA I use does not support combobox option. My code and interface works fine except one irritating thing. In first use, the combobox drops down for half a second then closes back. After the first use, there is no problem using it. I can not understand what causes this. Any help ?Thank you

Opening Visio Document Via Word 2000 VBA www.vbcity.com

In Word 2000 VBA:How do I open a Visio document via Word 2000 VBA?Peter Faulhaber

Access ActiveX - Class-property By Propertyname www.vbforums.com

HiDoes somebody know how I can access a property value of an ActiveX - Class by the property name (as a string)?The ActiveX-Class does not have a collection called "Properties".Example code: Dim obj As ActiveX.Class Dim a As Variant 'get value by property name a = get_PropertyValue(obj,"PropertyNameXY")Thank's for the helpBruno

Passing Variables/parameters From ASP To ActiveX www.codeguru.com

I need to retrieve a QueryString/Form variable posted via an ASP page to an ActiveX control so that I can then run a query against a database on the Web server via the ActiveX control. Can you show me how to retrieve the posted variable within the ActiveX Control(VB)?

VBA Collection www.vbforums.com

I am rewriting code written in an earlier version of VB and want to find out if there is a way I can dump data from a VBA collection into an excel workbook. I do not want to transfer the data cell by cell as this would take too long and I am considering rewriting the classes that contain VBA collections into an array so that I can dump the array into a range of cells in excel. Any suggestions are greatly appreciated.

Desiging ActiveX Where A Quick Tutorial www.xtremevbtalk.com

As a measure of emergency I need to prepare a very simple ActiveX object to be used in Excel sheet and VBA.I'm not a hardcore programmer myself but I'm able to put together a code in VBA to get things done. I have no experience compiling ActiveX dll's in VB though.Could anyone point me to a simple tutorial on the web where I could learn steps how to do it in VB? (project type, setting up methods for the control, parameters for compiling the dll so it's recognized as an ActiveX.. etc)The ActiveX object will be very simple - it's a stopwatch: 1. displaying elapsing time, I have it done already in VB as a windows ap. 2. As an object it will be taking only 3 types of methods: start, stop, reset 3. it has to be a proper ActiveX, so I can use "insert ActiveX" in Excel to add it to the sheet and the code. I guess I have to start with creating a 'class library' project, haven't I ?


Collections - Pass Data To ActiveX.exe? stackoverflow.com

I've created a MAPI Wrapper in VB6 and compiled it as an ActiveX.exe so I can use it in my VB.NET project. The project is a windows service that takes data from a webservice passes data to activex.exe and it creates public folder records in exchange 2003. I was wondering if anyone know how I could pass a collection to my activex.exe?

Error Handling Fails With Simple Example www.vbcity.com

Hello All,I have a rather large Access application that used to work completely before I installed Visual Studio .Net (maybe that means something)?Prior to installing VS .Net my code would appropriately invoke the error handler if I tried indexing into a Collection by key if there was no object in the Collection with that key.For example the following scenario previously would work fine:Code: Public Sub testcollection()       Dim c1 As New collection, c2 As New collection       Const NAME = "sss"         c1.Add c2, NAME       Set c2 = Nothing         On Error GoTo NO_OBJ:       Set c2 = c1.item(NAME) ' This line works   Set c2 = c1.item("qqq") ' Code Breaks here; should go to NO_OBJ:        Exit Sub        NO_OBJ:         Debug.Print "No Object"     End SubThis code snipet now fails when I try to run it.I suspect someting along the lines of:     1) A VS .Net .dll containing Microsoft.VisualBasic.Collection is interfering with the VBA.Collection     2) VS.Net overwrote a dll containing a dependency of VBA.CollectionBut, I haven't had any luck with these approaches, yet.Are there any other ideas on this topic?Thanks.

Changing Application Tools Options Chart www.ozgrid.com

how can I change via VBA the chart options in tools--> options-->charts

Declaring An UserForms Collection In VBA (Word) www.vbforums.com

Hello,Can please somebody help me?I'm trying to declare a UserForms Collection as follows:Dim glbl As vba.GlobalDim usrfrms As vba.CollectionSet usrfrms = New vba.CollectionSet usrfrms = glbl.UserFormsBut when I run my VBA-application (Word) I get the error '429', active-X cannot create an object.Who knows how th handle this?Chris Jonkheer

How To Call ActiveX EXE From Excel www.xtremevbtalk.com

Could some one let me know how to call an activex.exe program from excel.I've tried the getobject method but it didn't work.Dim CADObject As ObjectSet CADObject = GetObject("C:CADSCHEMA.CAD")basically I want to put part of my VBA code in activex.exe program and call it from excel to protect the source code. I've done this with VB dll file but my users don't have admin access to register the dll. that is why I'm looking for a way to create a activex exe that does not require registration.any help is appreciated.

Custom ActiveX In MS Access www.xtremevbtalk.com

I have created a custom ActiveX with VB6 and was going to use it in MS Access97. When I Inserted my ActiveX into a form in Access and went to write code I noticed that all of my properties and events for my control were there but none of my methods were accessible. Is there a way around this? I guess I could change my ActiveX to raise events when a property is changed and then respond to the events in VBA. Thanks.

How Did Microsoft Make Excel? www.vbforums.com

Hey,Does anyone know the framework for how Microsoft designed Excel?My understanding is that Excel documents are ActiveX documents. That makes the Excel program the ActiveX document server, right.Then, Excel also integrates VBA for running macros etc. That's easy enough.But, how does Excel allow the addition of ActiveX controls to the worksheet? Does it just "Add" an OLEObject? If so, how does it persist the OLEObject on the sheet to bring up the next time the sheet is loaded?

VBA Code To Add Option Buttons To ActiveX Frame? www.mrexcel.com

I want to write a VBA code that will place ActiveX Frame directly onto the worksheet and then add 3 Option Buttons from Toolbox into that frame. I could not find an answer searching through the web... Also when trying to record macro and see the code it did not record placing the buttons from the toolbox or any formatting (color, caption, etc.) via properties... When formatting the buttons it would be useful if the selected radio button would have different color, bold font, etc.

Collections And CreateObject www.xtremevbtalk.com

Hi gurus,I'm trying to use Collections on a web application, btw, i can't use:Dim mVarCol as CollectionBecause it's a Web application (ASP), it would'nt work.I was wondering, if there's anyway to make an instance of a Collection using Server.CreateObject ?(I tried Server.CreateObject("VBA.Collection") and it says Invalid ProgId)Can ne1 help me with that?Thanx for any advice.

Handling Mscomm From An ActiveX EXE www.vbforums.com

Hi!! I have an standard exe which communicates with several devices via serial port. I'd like to have an ActiveX EXE which handles the communication with a particulary device and raises an event for monitoring it from the standard exe.I'm not able to handle MsComm object events from ActiveX. Can anyone tell me how can I do this? (I can get an oncomm event from standard exe and let control to ActiveX exe, but I'd like ActiveX EXE handles everything)Thanks in advance!

ActiveX References forums.devshed.com

I have a question and I was hoping that someone would help out here...I have a Translator DLL which I wrote, it is full of collections for tables and column names in different languages.I have a MDI Form, which Creates an instance of the Translator DLLI have 15 other ActiveX DLLs that are smaller projects that make up my MDI.I need to pass all these projects the reference of the Translator DLL which I created, in my MDI to all these other projects.Now in my other projects, I have a Let Property, whichs just sets an object to the reference from MDI, which works fine.The problem is that 3 of these ActiveX DLLs dont just open directly from my MDI, my MDI calls it but it calls a function in another ActiveX DLL which calls another function in another ActiveX DLL and this continues for about 7 ActiveX DLLs down the line where my initial ActiveX DLL is actually opened.Do you know of anyway that I can just pass the Translator DLL reference directly to my ActiveX DLL without having to pass the reference through all these other DLLs? I was told that a VB CallBack would be able to do it but cant seem to find any info on it?Any help or suggestions please

User Control Design Time Collection? www.vbforums.com

This is a related to my last post, but not enough to make sense as a tag on question.I have a collection(of myClass) that is exposed as a public property in a user control.When I add an item to the collection in code I would make the call collection.add(new myClass) and of course the constructor for myClass is called.When I add items to the collection via the design time menu the constructor for myClass is not called.... of it it is called, I can't see any evidence of it.

Using .net COM Interop From Excel www.vbforums.com

I Programe a COM Library in VS2008 to use in Excel , but I'm stuck with an error that I don't understand. I use this two classes , that compile and register OK. One Class QBitems return a nongeneric collection of QBItem but when I tried to use the Add and/or Remove Method, I receive the following error in Excel VBA : Run-time Error '438': Object doesn't support this property or method. I added a class (SImpleClass) in the library and I called from VBA it returned the QItems collection without problem. NEW: When I replace the QBItem object with a string in the Collection QBItems everytthing works OK. It looks like interface doesn't like to pass an object like QBitem class Excel/VBA: Sub Pru() Dim obj As New CollectionCOMClass.SimpleClass Dim Itms As New CollectionCOMClass.QBItems [Code]....

Debugging A OCX, While The Startup Is A C Appl. www.xtremevbtalk.com

Hello,Problem: I want to debug a OCX, created with Visual basic. This sounds easy, and it works, but it doesn't work the way I want it....situation:I have an ActiveX server, which contains a form, with buttons, when a user presses one of these buttons (at runtime), a form will pop up, containing the usercontrol...this happens all at runtime...so the usercontrols will be added to the form collection at runtime.The activeX server is started by a C application...As long as I keep the OCX source, and the activeX server source in the same VBG file, and I start the activeX server first, before firing up the C application which uses it, everything(the debugging) works....But I do not want to provide the code of the activeX server...And when I only start the OXC, before the C applications starts..... Windows gives me an error message, telling me that he cannot find that guid in the registry when I press the button on the AxtiveX server, which wants to fire up the usercontrol, that is already running....Really strange....is there a solution for this problem, or do I really have to deliver the sources of the ActiveX server, so everyone can debug their OCXes...??

UserControls In ActiveX DLL's www.codeguru.com

I have two projects. Project 1 is a standard EXE. Project 2 is an ActiveX DLL. The DLL has several UserControls, which I'd like the EXE to be able to add dynamically into the Controls collection. Now, I understand that i should be using an OCX for this type of functionallity, but my preference is to use an ActiveX DLL. Is there any way to do this?

UserControls In ActiveX DLL's www.codeguru.com

I have two projects. Project 1 is a standard EXE. Project 2 is an ActiveX DLL. The DLL has several UserControls, which I'd like the EXE to be able to add dynamically into the Controls collection. Now, I understand that i should be using an OCX for this type of functionallity, but my preference is to use an ActiveX DLL. Is there any way to do this?

Exposing Interfaces www.codeguru.com

My VB application has to expose methods,properties and events of any activex component attached with it. I need to do this in a fly. Is there any collection or API's or any other interfaces of Windows NT I can use for enumerating the methods or properties or events of a particular ActiveX component that is registered.Awaiting your reply.VB guy

Help:Why Usercontrol Terminate Event Not Invoked www.codeguru.com

I write a activex control in vb, and I encounter a problem. IE can normally run my activex control, but when IE shut down, an error collection msgbox appears,And I trace the code, when run in IE, the usercontrol's Terminate event not invoked, why this happen, and how conquer it?Appreciation for any suggestion.Happy to be a programmer.

Properties www.codeguru.com

How do I get the properties of a class at runtime in an ActiveX-DLL ? For example:I have in my program a collection of all used classes (ActiveX-DLL-Classes, Classes used for the application. My application has an interfacewith the functions:AppGetClasses (Byref a() as Variant) as IntegerAppGetProperty (ByVal XX as class, Byref a() as Variant)with function one I want to get all classes and with function 2 I want to get the used properties of the class. chris

Bad Index Type For Collection www.vbforums.com

Hi All,I'm using an ActiveX control to interface to an SAP scripting API object and when I access the Rows collection using Rows(index) I can only use a constant for the index - if I use a variable of either Long or Integer type I get "Bad index type for collection access" error. I can't find this error documented in the MSDN and have no clue about why it accepts a constant and not a variable.Has anyone else seen this? Many thanks in advance for any help you might have to offer!

ActiveX EXE - Best Practices Question www.xtremevbtalk.com

I need some help determining if I should be doing what I am thinking about doing...I want to create an ActiveX EXE that can both be launched via command prompt, and via class instantiation, to do seperate actions. The project has two classes. Sub Main is defined as the Startup Object.Scenario #1: ActiveX EXE is launched via command-line. Sub Main is called, Class1 instantiated from there, Class1 code happens.Scenario #2: ActiveX EXE Class2 is instantiated by another VB project (standalone Exe). Sub Main is called but exited immediately by a test of App.StartMode at the beginning. Then the class Initialize follows, Class2 code happens.- The problem I ran into quite immediately is that I can't debug the ActiveX EXE as if it were launched from the command-line. I can only debug Scenario #2. Is there a way to debug Scenario #1?- Am I totally off base in trying to attempt this scenario?

XML Feed - How To Get Collection Of Elements (Assets) Via LINQ stackoverflow.com

I have the following XML which I load via XDocument.Load(uri) or XElement.Load(uri). I am having trouble getting a collection of <asset> elements via LINQ. Here is a snippet of the XML I'm trying to query: <assetCollection xmlns="tag:aisle7.net,2009:/api/1.0"> <title>All Assets</title> <description>Collection containing all assets in the system</description> <resourcePath>/us/assets/~all</resourcePath> [Code] .....

Stream ITunes Music From PC Using IPad As Interface? forums.macrumors.com

I want to stream my iTunes music collection via an Airport Express to my amplifier and speakers. My iTunes collection is about 60GB. Is there any App that enables me to control iTunes from my iPad so the iPad is like an interface for the iTunes content on my PC? So i can see all my albums on my iTunes PC hard-drive, choose a song from my iPad and then stream the song from my PC to my amp via Airport Express?

Posting Picture On Command Button www.xtremevbtalk.com

Hi, I would like to know how to paste an image (bitmap) on a commandbutton (forms) via vba code. Thanks, Sudhakar

Adding To Outlook Menu www.vbforums.com

Is there a simple way via VBA to add a Menu button to Outlook 2000 when the application starts up?Thanks,Josh

Efficient Method To Use A User Defined Type In Class Object ? www.codeguru.com

Question:Which method is the efficient method to use a User defined Type in Class object Out of 3 methods? Consider Advatages and Disadvantages when used in a big project.Method 1 : Use ActiveX dll to define User Defined TypesMethod 2 : Change Project Setting to ActiveX EXEMethod 3 : Create Another Class Object of User defined typeFrom the search results I found mostly Method 1 & Method 2 to solve User defined type in a Class Object, But I did it with Method 3 also.A dummy Example to show it: I need to use a user defined type in a class moduleand to use as a collection of that class objectand access it from a form moduleSay I have Class Named myCarIt have a User defined Type Property RECT to indicates its position in ScreenCode:' Class myCar (Class Module 1)PUBLIC carPos as clsRECTPUBLIC carColor as long'End ClassClass Module to Define User defined TypeCode:' Class clsRECT (Class Module 2)PUBLIC left as longPUBLIC top as longPUBLIC right as longPUBLIC bottom as longI used above myCar object Class in a collection Class module named myCarsCode:' Class myCars (Class Module 3)' [code for collection of myCar Object Class]'[End Code for myCars]In my Form module I need to declare Code:Dim mCars as New myCarsmCars.add "car1"mCars("Car1").carPos.Left=100mCars("Car1").carPos.Top=100mCars("Car1").carPos.Right=180mCars("Car1").carPos.Bottom=220mCars("Car1").carColor=vbRed

Word - Deleting A Table Of Contents Via VBA www.xtremevbtalk.com

Anybody have any ideas on how I would be able to delete a table of contents contained within a word document via VBA?

... Big Problem With A Window Of Non Windows Application www.xtremevbtalk.com

is possible to set via VBA this param?For example write the path file, chek the box.....see image.http://www.gssitaly.com/extra_prn.jpgTks for all posts

Automating Outlook Address (pst) Files. www.vbcity.com

Is it possible via VBA to automate importing of personal address files (.pst) into Outlook 98 ???????.

Select Only Year Via Vba www.mrexcel.com

I have a date lijke : 10.10.2009 How can I via VBA select, only the year , like 2009

Send Data Between Other Office Programs www.excelforum.com

Is it possible to send the contents of a cell to outlook via VBA trigger?

Programmatically UpdateNamed Range www.excelforum.com

Programmatically UpdateNamed Range. Is it possibly to update a named range via VBA?

2007 - Compatability Checker www.mrexcel.com

Does anyone know if there is a way to turn this off via VBA?

Popluate ComboBox Via VBA www.mrexcel.com

Is it possible to populate a combo box via VBA possibly a two-dimensional array?

How To Know The Version Of SQL SERVER www.vbcity.com

is possible to know, via VBA or VB classic, wich version of SQL SERVER run in Local?Sal21

Adding Bullets And Indenting Bullets To Selected Text In A Autoshape Via VBA Code www.eggheadcafe.com

Adding bullets and Indenting bullets to selected text in a autoshape via VBA code ...?

Outlook: Out Of Office Assistant www.xtremevbtalk.com

How do i enable/disable the out of office assistant via VBA?

Public Objects In Out-of-process Servers (activex Exe) And ASP www.vbcity.com

Hi!!I got an activex exe with a public collection (in fact, that is a private collection declared in a module, with public Property Get for it, so it is public..). This out-of-process server is called by a few process, including a particular dll (in-process server, activex dll...) which is at its turn called both by a simple exe(1) and by IIS through Server.CreateObject on a web page.starting use-case: I start a first exe, which references the out-of-process exe and puts data in the public collection.Use-case 2.1 : I run the simple exe(1), which loads the dll, which "loads" the out-of-process server. Result : I have access to the global data (the public collection contains the data I put there first).Use-case 2.2 : I run the web page, which loads the dll (server.createobject), which "loads"... you see the picture. Result : I DON'T HAVE ACCESS to the public collection, the object is empty!!!!! It looks like a completely new instance of my out-of-process server has been loaded, with an empty collection!!! Nevertheless, it's been loaded, in both use-cases, by the same dll, which is always in-process... so in both cases, a called to the out-of-process activex has been marshalled, and the same public collection should be there... Someone understands something???Dave.

Open Firefox Browser And Navigate To Website Via VBA? www.mrexcel.com

is there any possibility to open the firefox browser and navigate it to a website via vba?

Can't Insert Formula To Cell Via VBA www.mrexcel.com

I can't insert this formula to cell via VBA. Code: Range("AB38").Formula = "=TAN((RADIANS(VLOOKUP(G38,TABLE_24))))*(Z38-AA38)"

Copying An Open Access Database - Version: 2002 (10.0) XP www.utteraccess.com

Are there any forseeable problem with copying an open database to another location via VBA?

How To Add Attachement And Text To Outlook Via VBA www.mrexcel.com

How to add a specific attachment and text from excel to outlook via VBA?

Check If Sheet1 Has Any Conditional Formatting On It Via VBA? www.excelforum.com

How can I check if Sheet1 has any conditional formatting on it via VBA?

Vb6 Collection Class - Methodology? www.vbforums.com

I don't specifically want code help here but I am curious about the methods employed when using collections. eg. I have a project which uses a list of customers and for each customer there could be several branches (delivery addresses). the data for each type is writtten to different access tables via ado calls. I build the customer collection via selecting customers as required. (here the branch data is retrieved via other routines and written directly to tables via ADO)..I could easily build a recordset property into the customer class and write a simple routine to store the branch data (recordset) in the customer class as I select each customer and then write the customer class to the collection. although this could give me 'one interface' to retrieve data from /write data to tables from but is it right to attempt this? is there any better way?thanks for any advice/help in advanceGaz

Property Page Development For Activex Control www.vbforums.com

Iam a NERD vb programmer .I am at present working with activex controls.I want to know how to develop property pages for a particular activex control?I want to allow the user to set the time property for a timer which is a activex control I have developed.I want the user to set the value of time in secs at run time via property pages.I require the coding also as I am a beginner.I have posted the same question previously also but I haven't recieved even a single reply.I really thank the person who helps me to learn property page development .Any one with a possible solution can contact me at:s_subbarayan@yahoo.com

Crystal Report ActiveX Vs Crystal Report Wrapper.bas www.xtremevbtalk.com

When print a report via Visual Basic, is it recommended to use the methods and properties of the ActiveX or using the functions provided by the wrapper, such as PEOpenPrintJob and etc.? If there's no diff in using both, then I have a question. There is a PEClosePrintJob function in the wrapper, however, there isn't any methods or properties in the ActiveX to perform such function. What will happen if PEOpenPrintJob (called by ActiveX's ReportFileName) is executed x times but the print job is not closed at all?Regards.Brandon

Active X Control www.xtremevbtalk.com

Can an activeX control for use on a webpage gather session data from the connection?I have an activeX control that hopefully I am going to use to simplify some inane tasks, but it needs to know what it has permission to show, and not to show, which is stored in a session array via PHP on the website.Can the ActiveX control access the sessionarray?Many Thanks.Dave

.net 2010 How To Work With Collections List www.vbforums.com

I'm trying to learn how to work with Collections list. In the past, if I wanted to create a list I would use an array and then save it to a text file after I was done manipulating the data via CSV.how to save things of different types to a list such as: Name, Birthdate(as date), Salary I know how to do this in an array but all the synapses aren't firing with the "new to me" collections list as collections lists are hard typed....

Collection Classes www.xtremevbtalk.com

I want to do a collection to hold users on a Winsock server, and would like to identify people via the nickname they give, i have found the name collection classes but have no idea how to do them. What i want to be able to do is call something like Users("jumentous").IP to get the users ip address and IP is obviously not a standard collection component. I Could create a class that does this using a type and an array but i would prefer not to. Any help is appreciated.

Making The Wrapper Object - Dumb www.codeguru.com

I have written a COM object in VC++ which acts as a container/collection class for other COM objects. I create objects and add it to my collection. My collection then releases the stored objects when it is destroyed.I do not release the added objects.When I use it from VC++ via a dispatch wrapper i can tell the dispatch wrapper to turn of the autorelease flag and everything goes fine. But the same in VB causes the IDE to crash.Is there some way to turn off autorelease in the object.many thanks- Shyamal Bangalore, India

Excel 2003 :: VBA / Reference ActiveX Controls In A Cell www.mrexcel.com

In VBA (Excel 2003), I'm wanting to get a reference to an ActiveX comboBox that is inside/attached to a cell. I can iterate thru all the OLEObjects in the OLEObjects collection of the Worksheet and test the .TopLeftCell property to see if it matches my target cell. However, this seems like a long way around the problem - particularly if there's hundreds of comboboxes in the sheet. Intuitively, I would have thought there would be a Cell.OLEObjects collection, but it appears that there isn't. Is there a quicker and easier way to get a reference to the OLEObjects within a target cell?

Structuring My DB Class Objects. www.vbforums.com

I am trying to get to a point where we don’t have to do any SQL/Database coding. So far I have four classes, Connection, Lookup, Customers and Customer. The Connection handles the connection and holds the Username, Password and Server properties.The Lookup handles the SQL for returning Customers from the Oracle Database and passes the data to the Collection.The Customers class does the adding to the collection, the Count, Remove etc.The Customer class holds the defined variables and the ID for the collection.Now, my intention is to add more SQL functions to the Lookup class, but I will need to add classes to handle the collection population and collection properties.How many classes can I add to my Project/ActiveX dll before it goes belly up or I lose control of what’s going on?How do I get the data into a Data Grid? Do I add yet more classes for Customer_Fetch?Has anyone got a design/model/document on how they have done this?

Distributing VBA Applications With ADO www.vbcity.com

Right now, i'm writing a VBA program in excel, which needs the Microsoft ActiveX Data Objects 2.x reference loaded in Excel to run.Now, this is all okay if I run it on my own computer, but I have to distribute to other users. How do I ensure that their computers have this particular reference/activex control loaded?I have heard in passing about mde, but have no idea what isit. Does it have any relevance to my problem?I thank you in advance for your help.xycodex

ActiveX FlexGrid www.xtremevbtalk.com

Hi,I Search for an ActiveX like MSFlexGrid for put on a FormBut I Need an ActiveX that I Can put a ComboBox on a cell or on all the cell of a rowBecause I found one but only for put combobox in all the cell of a ColI must can change the value of the combobox with a vba codeHave Someone this ?Thank you

Writing An Access Query To Excel File (.xls) www.xtremevbtalk.com

Hi there!I'm usin VBA to make applications in Access97, I want to run a query and get a result collection, and write the collection to a Excel file (.xls)I found a function for it with a parameter xls but that is a year ago and I lost the note. may be some docmd.Thanks for the help.

Integrating VBA Into VB App www.vbforums.com

I am trying to integrate VBA into my VB app using the VBA SDK.I want the user to have access to some UDTs in my app via VBA. Is this possible, or do I have to convert the UDTs to Classes?Anyone know of any good "tricks" to expose UDTs to the VBA editor?My UDTs were classes, but I converted because they (the classes) caused my app to run way too slow, so I really really dont want to convert back to classes.Any help greatly apprecitated.

Excel VBA Limitations Question www.codeguru.com

Hi,I'm writing an application in VB that will consist of two parts.1) a VERY thin UI layer which just handles events, populating the UI controls etc.and2) an ActiveX server (either .dll or .exe) that the UI will call for all it's processing.I'm using this architecture so the UI can be replaced with one written in another language, and the ActiveX server can be used by another application if necessary.My question is, what are the limits of VBA in Excel and Word? I need to investigate the possibility of later putting the UI in an Excel application and calling my server from there.Also (this is very important), can VBA handle asynchronous communication with an ActiveX server using Events and call-back functions. Can it also handle classes.Thanks for any help you can give me. Please email me if you need more details.Tom.

Excel VBA Limitations Question www.codeguru.com

Hi,I'm writing an application in VB that will consist of two parts.1) a VERY thin UI layer which just handles events, populating the UI controls etc.and2) an ActiveX server (either .dll or .exe) that the UI will call for all it's processing.I'm using this architecture so the UI can be replaced with one written in another language, and the ActiveX server can be used by another application if necessary.My question is, what are the limits of VBA in Excel and Word? I need to investigate the possibility of later putting the UI in an Excel application and calling my server from there.Also (this is very important), can VBA handle asynchronous communication with an ActiveX server using Events and call-back functions. Can it also handle classes.Thanks for any help you can give me. Please email me if you need more details.Tom.

Access 2000 VBA Importing Userdefined ActiveX www.codeguru.com

Hi friends !I'm running in an old VBA Access problem. I have a Access mdb full of code written in vBA by myself in the medium of the 90 th when it was Access 1.0 This was upgraded and upgraded and code adapted so the last version of access we have is 2000 and program is still fine. But now I have to add an activeX, which I have written in VB especially for this old program. The activeX is tested in VB6.0 works, the ocx is comiled and put into windowssystem32 and registered. But I cannot see my control in the tools and I'm not able to add it to the activeX list of access. When I try to add the .ocx file nothing changes. I have heard once by rumor that there are needed some special settings if anyone wants to write a control that can be used in MS Access. Anyone knows whats needed exactly ?

Capture VB Events In VBA www.xtremevbtalk.com

i have an activex dll programmed in VB6. with a userform which is a progressbar actually. in it i have a CANCEL button just in case user wants to cancel in mid operation.i call this userform from an application in excel's VBA, so what i need is to catch the cancel event in my VBA app, being that the userform is in the DLL.any ideas?

Asynchronous Execution For VBA Module www.codeguru.com

Does anyone know how to execute an Access VBA module asynchronously in VB6? The code I have at the moment (synchronous):Quote:'Connection stringstrAccConn = C:PolicyBordereauxDataP27G.mdb 'VBA ModulestrSQL = RunP27GPrivate Sub VBAModule(strAccConn As String, strSQL As String)On Error GoTo ErrorHandlerSet AccessDB = New Access.ApplicationAccessDB.OpenCurrentDatabase strAccConn, FalseAccessDB.Run strSQLAccessDB.CloseCurrentDatabaseExit SubErrorHandler:strErrDesc = Err.Description Call ErrorHandler(strQAuditGUID, strErrDesc)End Subany idea how this can be run asynchronously in the main application? Not through an ActiveX EXE if possible.Thanx!

Excel 2010 :: VBA To Change Form Control Checkbox Background Color When Checked www.mrexcel.com

I have an Excel 2010 workbook with many worksheets using hundreds of Form Control (not ActiveX) checkboxes. I need a bit of VBA to change Checkbox background color of each checkbox whenever the user checks the box. I assume this needs to be a click event? I don't even know the Checkbox property name I need to change I'm learning VBA as quick as I can

Populating From One Sheet To Another, By Date www.excelforum.com

I am trying to total up by a Range of Dates some information from one page to another through VBA. I am having a tough time with this one, I can't seem to get the correct information over to the other page. I have successfully been able to transfer the data via a series of SUMIF statements, but it really is very inefficient and takes a while when the data repopulated by another program. So I am trying to do it via VBA.

Convert A CSV File Into A Formatted File www.excelforum.com

I tried many ways to convert a CSV file into a formatted Excel (.xls) file via VBA. I have a file with 5 lines (header included) and about 10 columns (delimited by commas). How can I format it via vba on button click action?

IE6 Automation In VBA - Open A (child) Page On Clicking A Button In Main (parent) www.mrexcel.com

My query is regarding internet explorer 6 automation via code in VBA (Excel 2003). I'm trying to open a page on clicking a button in main page. I'm able to open both parent and child pages via VBA, but now want to automate events (like radio btn click etc) in child page. below is my initial code - '======== Sub ListLinks() Dim IeApp As InternetExplorer Dim sURL As String Dim IeDoc As Object Dim i As Long 'Create new instance of IE Set IeApp = New InternetExplorer

Excel VBA Radio Buttons www.xtremevbtalk.com

In Excel, there are apparently two types of form controls that can be used. There are controls on the Forms Toolbar and there are also ActiveX controls. I am trying to use radio buttons. Apparently the ones from the Toolbar simply put a value in a cell of the spreadsheet when selected. Any VBA written must evaluate the cell. VBA cannot directly evaluate the control. The activeX control can be manipulated directly from VBA.Am I correct in this understanding?Thanks in advance.

Setting Container Property To A Different Usercontrol www.xtremevbtalk.com

Hello!I've created an activex control project with two usercontrols inside,one public and the other private, and both with controlContainer=true.From a test standard exe project, I'm trying to display a graphical objectwithin the private usercontrol in the activex control project.This is how I proceeded:1) From the test project, change the graphical object's Container property to the public usercontrol. This works fine.2) From the public usercontrol, access the graphical object via the ContainedControls collection and change again its Container property tothe private usercontrol. This raises the following error:"Runtime error 425 -> invalid object usage."The code I'm working with (in the public usercontrol):...dim containedControl as objectfor each containedControl in userControl.containedControls if containedControl.key=searchedKey then set containedControl.container=miPrivateUserControl end ifnextIs there any other way to establish the Container property to the privateusercontrol from the public one?Thanks.

Multipage Control Problem www.xtremevbtalk.com

I'm using a multipage control to build a wizard form in VBA in excel 2000. The form works great when running it in the VBA debugger, however when I run it directly via a button on my excel sheet, the multipage control will not change the active tab even though the multipage.value changes. What's going on here - have I hit an excel bug?I also had a problem with the form losing focus on hitting the "next" button, fixed that via the focus property. This problem only manifested itself when running outside of the debugger.Thanks!Joe

GetObject W/ Multiple Instances www.codeguru.com

What I need to do: A standard EXE needs to get a reference to an Activex application (a CAD program), where multiple instances of the other program may be running.- Using GetObject is impractical because I have to rely on knowing the filename of the currently open file in each instance in order to get a reference to them (if you have ever tried to use GetObject where the app you want has multiple instances running then you know what I'm talking about...)What other options do I have? Something I have done in the past was to make my EXE and Activex DLL instead, then reference it from a VBA project in the CAD program something like (this code in a vba project in the CAD program):Sub EstablishInstanceReference() Dim myProg as New myProg Set myProg.ConnectedTo = CAD.ApplicationEnd Sub... now myProg has a valid reference to the instance that created it. In that case it was ok because the DLL was a tool for programmers to use so they were writing code anyway. The end users in this case are not programmers and I don't think they should be poking around w/ VBA. I'm open to any suggestions...

Refreshing Linked Oracle Tables Via VBA - Version: Any Version www.utteraccess.com

I have to occasionally refresh some Oracle tables that exist as links in my access database. I typically do it via the GUI interface (Linked Table Manager) but would like to do it via VBA. If they are not refreshed, when I try to connect, the connection doesn't work. Is there a way to do this with VBA?

How To Avoid Data Labels Overlapping X Axis In Charts www.mrexcel.com

I have a dynamic column chart that may contain positive or negative (or both) values. The columns contain Data Labels positioned 'Outside End'. I want to avoid the Data Labels (for the negative values) overlapping the x axis. Is there a way to do this via VBA? I know how to update the chart axis via vba linked to cell values, but I can't figure out a formula I can use to calculate the minimum which takes into account the distance needed to avoid the overlapping problem.

How To Get Full Path To EXE From An ActiveX? www.vbcity.com

Dear ColleaguesIs there a way to retrieve absolute path to running executable file from ActiveX? There are standard EXE file written in VB6 and an ActiveX Control also written in VB6. In the EXE is instantiated the ActiveX and inside ActiveX code I need to get full path to EXE. App.Path returns path to the ActiveX. Currently I see only one approach to solve the problem: pass path via method parameter/property to the ActiveX from the EXE. But maybe there is more elegant way?Thank youMartin Rakhmanov

Accessing And Adding Items To A Collection That Is In A Collection? www.vbforums.com

currently in my application I have a Global Collection that is a Collection of Collections.Currently I am trying to add items/ elements to one of the child collections of the Global Collection but I am unable to use the collections methods of the child.When I assign a variable to the child collection and return the collection it is just an object with the collection inside. Ex: Dim GlobalCollection as New Collection Dim ChildCollection1 as New Collection Dim tempCurrentCollection[code]......

Sort Data From An Existing Collection And Save It Into Another 2nd Collection www.xtremevbtalk.com

Hi, have a huge problem. I have an existing collection and would like to use this collection to save some data from it into another collection. The Problem is: in the 2nd collection I only have e.g. 5 times the same number. I'm using an if-loop for that, maybe the reason for it...But before, I just try to explain a little of the structure (otherwise maybe my words doesn't make much sense to you).My already working 1st collection has some properties which I fulfilled via an SQL-recordset.I just want to use this information to 'sort' it in order to allow a correct graphical and hierarchical presentation (via an algorithm) on the screen -> like an organigram.My 1st, working collection looks like: Code:dim x as my_object Dim records As ADODB.Recordset Dim sql1 As String Dim strCnn As String Dim my_collection As New Collection Set records = New ADODB.Recordset strCnn = "Provider=some;User ID=one_user;Password=one_password;Persist Security Info=True;Initial Catalog=server;Data Source=server" sql1 = "SELECT ...................." rs_app.CursorLocation = adUseClient rs_app.Open sql1, strCnn, adOpenKeyset, adLockOptimistic, adCmdText While Not records.EOF Set x = New my_object If IsNull(x) = False Then x.my_key = records("my_key").Value 'ist eine Eigenschaft x.my_overkey = records("overkey").Value my_collection.Add x records.MoveNext Else End If Wend-> So far so good, that works!! HOWEVER, if I furthermore would like to sort that after a special criteria (e.g. just save all "my_key's" in another collecton, which have the "my_overkey" number "0815" then won't work.If I have 5 numbers (which belong to 0815) then I get 5x the same my_key - number. I guess the reason for that error is the if-loop.Does anybody know an solution/a better way for that? ?my solution looks like: Code:dim collection2 as new collection ' defined via class-builder set collection2 = new collecton For i = 1 To my_collection.Count 'type_app habe ich dann als "0815" definiert If my_collection.Item(i).my_overkey = type_app Then y.my_key = my_collection.Item(i).my_key y.my_overkey = my_collection.item(i).my_overkey collection2.Add y end if nextWould be very grateful for any suggestion!!Thanksnew_one

.net - WP7 Custom Class UI Binding? stackoverflow.com

I have a map with a MapItemsControl in my WP7 app that contains pushpins bound to items in a collection of custom classes. The pushpins are bound to properties of the item in the collection via a DataTemplate.When an item is added to or removed from the collection, all pins display correctly, with properties as per bindings, but when just an items' properties are modified, the UI does not update. The bindings just seem to get values from the source item upon loading, but I'd like them to keep the UI elements updated when the source collection items' properties are updated.To illustrate, I'll create a similar example: Heres a custom class: Public Class Box Property CurrentColor As Color Property Location As GeoCoordinate End Class [code].... Whenever I add or remove items from TempBoxes, the pins all render as they should (e.g. if I specify a color in the collection item, the pin shows the color).Tapping on the item triggers the BoxTouched sub, which causes the item's color to change in the collection, but the UI doesn't change (pin color stays the same).To get the UI to update the color, I have to get it to render the pins again, by adding something like this to BoxTouched: BoxControl.ItemsSource = Nothing BoxControl.ItemsSource = TempBoxes

VB Printers Collection Object Problem www.xtremevbtalk.com

I have an ActiveX EXE app which is instantiated by a SQL Server stored procedure (sproc). The app's primary function is to print a report and send an email notification.The ActiveX app is set to a local Admin account (using dcomcnfg.exe).Normally the server has an Admin user account logged in to perform other tasks and this process goes smoothly during prototype. However, when no Admin user is logged in, the report stops printing but email continues to be sent which means the ActiveX app was initiated. Further investigation, I discovered that the VB Printers Collection is empty when there are no active Admin login sessions. I tried reconfiguring the ActiveX security setting but no success.I also tried redesigning the concept using a normal windowless application to be invoked by NT Scheduler on a periodic basis, but the concept fail also as any VB app invoked from NT Scheduler will not print. This is a limitation with NT Scheduler.Has anyone come across a similar dilemma? Any ideas would be appreciated.Thanks

Adding Menus Automatically In Excel Via VBA www.codeguru.com

I need a VBA program, which can automatically add a custom menu in Excel. I know how to add a menu manually, but if many users are going to use the program it would be nice to have some kind of installation program. I the older versions of Excel (v7) VBA the menu was 'attached' to the XLS file with the VBA code, so when you executed the file automatically via XLstart the menu was there, but that is not the case anymore...

SUMIFS In VBA With Date Ranges? www.mrexcel.com

I'm trying to recreate a formula in VBA, but struggling with the "greater than /equal to start date" and "less than / equal to end date" parts this formula works ok in the spreadsheet: Code: =SUMIFS(bbHours,empCodeList,thisEmployeeID,bbDate,">="&startDate,bbDate,"=" & startDate, Range("bbDate"), "=" section, but unclear how to handle this. It must be handled entirely via VBA, not formulas Note: I've adjusted certain key names / VBA strings for clarity, everything is defined correctly

Disable All Menus Etc When Starting Access 2007 Database - Version: 2007 (12.0) www.utteraccess.com

I have a number of production databases that use VBA to disable the user interface (menus, toolbars etc) when the database starts up. VBA also disables the shift-bypass key so they can't get in that way either. When I move these to Access 2007, what else must I disable via VBA code or whatever so that the user can't get to the database container and defeat my code to keep them strictly in the user interface? TIA NorthNone

Changing Properties Of An Activex From Another Activex Object VB6 www.vbcity.com

I want to change the properties of an ActiveX object written in VB6 from another ActiveX object written in VB6. Both of these ActiveX objects are located on a third ActiveX object. I can do it easily when both ActiveX objects are on a ActiveX container by using parent.object_name.property_name = true. I know you probably think it isn't necessary to put two ActiveX objects on an ActiveX but in this case it really is.Edited by - rebortne on 7/6/2005 8:12:40 PM

How To Show Form? www.codeguru.com

I want to shift an ActiveX-EXE on another PC and using DCOM to get in connection with it. It works fine and I can access any function, but why is it impossible to show a form (or MsgBox) on the remote PC (AX-EXE server)? I used the same code in the AX-EXE as shown below:Private mFrm as Form1Private Sub Class_Initialize()set mFrm = new Form1Load mFrmmFrm.ShowEnd SubPrivate Sub Class_Terminate()Unload mFrmset mFrm = nothingEnd SubThe project settings are ActiveX-Component.The DCOM connection works already!I launch the AX-EXE server via a Standard-EXE.Thanks for any help!Sascha

How To Show Form? www.codeguru.com

I want to shift an ActiveX-EXE on another PC and using DCOM to get in connection with it. It works fine and I can access any function, but why is it impossible to show a form (or MsgBox) on the remote PC (AX-EXE server)? I used the same code in the AX-EXE as shown below:Private mFrm as Form1Private Sub Class_Initialize() set mFrm = new Form1 Load mFrm mFrm.ShowEnd SubPrivate Sub Class_Terminate() Unload mFrm set mFrm = nothingEnd SubThe project settings are ActiveX-Component.The DCOM connection works already!I launch the AX-EXE server via a Standard-EXE.Thanks for any help!Sascha

VB6 Pass Value From Dll To Exe www.codeguru.com

Hi,my project is based on VB6 Activex Dll , Activex Exe and ASP 3.0In Activex Dll I'm storing Session ID in one variable.How can I get the value (Session ID) stored in that variable in Activex Exe?My code is as follows:1) VB6 Activex Dll Code:Public Function GetSession(ByRef SessionID As String) As StringGetSession = SessionIDEnd Function2) ASP Code:<% Dim SessionIDDim objMyComponent Set objMyComponent = Server.CreateObject("COMSession.clsSession")SessionID = objmycomponent.GetSession(Session.SessionID)Response.Write SessionID %>3) Now, I want to write an Activex Exe to get Session ID in VB6 Activex Dll.or Tell me the way to get Session ID in Activex Exe from ASPHelp me.ThnksRajesh N.

Changing File DSN Path At Runtime www.xtremevbtalk.com

I am creating an ActiveX control that will conect to a foxpro free table.The activex will recieve a "data path" from it's parent app when activated.I am currently connected to the free table via "file dsn". Is there any way that I can chage the data path of the file dsn at runtime?my current code is as follows:recordsetX.Open "Select * From freetable.dbf", "filedsn=mydsn;", adOpenDynamic, adLockOptimisticI am able to access the table freetable but if the parent app moves the location of free table I need to be able to change the filedsn path accordingly.Thanks in advanceCaneye

ActiveX Container Linkage www.vbforums.com

Hi,I have an embedded ActiveX object in my webpage which I load via Internet Explorer. How can I make Internet Explorer change the current webpage from within the ActiveX object?Thanks in advance.

Threading A Class (I Guess?) www.xtremevbtalk.com

My ActiveX DLL is working pseudo perfectly..I say this because..I have 5 test clients....When i have the 5 clients open, and one by one click 'Get Data', which calls the activex dll to get the data via xml, the 1st one gets its data almost instantly...The other 4 have up to a 15 - 20 second wait, then they all 4 seem to get their data at once as well..What is causing this behaviour?

Sending Emails Using An MS Access Form Via SMTP www.vbcity.com

I currently have an Access DB which sends MS Excel Attachments via a query and form via Outlook. We are switching to Lotus Notes and I'm looking for a way to send the same reports via SMTP. Does anyone have the Syntax for sending emails using VBA in Access to send them via SMTP. Thank you,Kevcox

Out Of Process COM ActiveX Control? www.codeguru.com

Anyone done anything with out-of-process ActiveX (if there is such a thing)? I and a C++ colleague are trying to get a COM .EXE (in C++) accessible from VB. The activeX test container allows it, but VB doesn't appear to. We need separate thread of execution, hence not a normal OCX/DLL, and need to generate events within VB from the separate "control".We also want to do this via VBScript on a web page eventually.Anyone got any ideas?Keith Fearnley, Trackit Systems Ltd, England

VB6 Pass Value From Activex Dll To Activex Exe www.vbcity.com

Hi,my project is based on VB6 Activex Dll , Activex Exe and ASP 3.0In Activex Dll I'm storing Session ID in one variable.How can I get the value (Session ID) stored in that variable in Activex Exe?My code is as follows:1) VB6 Activex Dll Code:Public Function GetSession(ByRef SessionID As String) As StringGetSession = SessionIDEnd Function2) ASP Code:<%          Dim SessionID    Dim objMyComponent                    Set objMyComponent = Server.CreateObject("COMSession.clsSession")                SessionID = objmycomponent.GetSession(Session.SessionID)        Response.Write SessionID                   %>3) Now, I want to write an Activex Exe to get Session ID in VB6 Activex Dll.or Tell me the way to get Session ID in Activex Exe from ASPHelp me.ThnksRajesh N.