VBA Express Forum  




Go Back   VBA Express Forum > VBA Code & Other Help > Integration/Automation of Office Applications Help
     Feedback     
Register FAQ Members Arcade Knowledge Base Training Articles Consulting

Reply
 
Thread Tools Display Modes
Old 07-01-2004, 10:31 PM   #1
Steiner

 
Joined: May 2004
Posts: 217
Kb Entries: 13
Articles: 0
Question Solved: Export properties of VBA-object?

Hello all,

this is a overall VB-Q (I did not find a solution for VB 6 nor VBA ):
I want to export all properties of an object at runtime. So let's say I have:
VBA:
Private Sub CommandButton1_Click() Dim myTxt As TextBox Set myTxt = TextBox1 Stop End Sub
VBA tags courtesy of www.thecodenet.com

Now I can view all properties of myTxt in the local window. But how can I export them in a way, that another program could read it (so PrtScr is not an option)??

Thanks
Daniel

Local Time: 10:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Old 07-02-2004, 10:34 AM   #2
Anne Troy
 
Anne Troy's Avatar
Site Admin
The Princess

 
Joined: May 2004
Posts: 2,524
Kb Entries: 19
Articles: 0
I moved it to the appropriate forum, Daniel.


~Anne Troy

Local Time: 05:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Old 07-02-2004, 04:31 PM   #3
mark007
 
mark007's Avatar
BoardCoder
Licensed Coder

 
Joined: May 2004
Posts: 603
Kb Entries: 6
Articles: 0
If you know what object you are looking at, then the answer is fairly simple. Otherwise, however, I think it would be harder. I can't think of any way to easily loop through every property of an object, so I'm thinking the only way would be to read the info from the type library, which I can't say I've tried before. That, plus I'm as it's late Friday night, and I'm inclined to ask why do you want to do this?



"Computers are useless. They can only give you answers." - Pablo Picasso
Mark Rowlinson FIA | The Code Net | Professional Office Developers Association

Local Time: 10:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Old 07-05-2004, 05:05 AM   #4
Steiner

 
Joined: May 2004
Posts: 217
Kb Entries: 13
Articles: 0
Well, basically I'm looking for a way to export all properties of 2 controls (at runtime) to Excel to easily compare them. Because one of them does work, another one does not.

But the original purpose is not so urgent anymore, but I was wondering, whether there is a way to export those properties (maybe a loop or something like that).

Daniel

Local Time: 10:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Old 09-22-2004, 07:14 AM   #5
Juan Pablo Gonz?lez
MS Excel MVP

 
Joined: May 2004
Posts: 30
Kb Entries: 0
Articles: 0
Try downloading the Type Lib utilities file available at Chip's site:

http://cpearson.com/excel.htm

From the site:

Quote:
Download XLTLI - Type Lib Utilities
This download provides about 20 VBA utility functions for working with the TypeLib Information object library, which is used to read type libraries. TypeLib Info is the "engine" behind the VBA Object Browser, and this library gives you programmatic access to type libraries, allowing you to determine the various arguments for methods, the symbolic names of constants, the methods of an object and so on. Complete documentation is in the VBA code of this workbook. This code is for advanced VBA programmers, not novices. An advanced version of XLTLI is available for commercial customers.



Regards,

Juan Pablo Gonz?lez

Local Time: 03:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Old 09-28-2004, 05:29 AM   #6
Steiner

 
Joined: May 2004
Posts: 217
Kb Entries: 13
Articles: 0
Thanks for the tip Juan , but unfortunately I can't yet get it to work with Excel 97 (that does not support Enums ).

I'll try to find a way around that...

Local Time: 10:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Old 10-03-2004, 06:43 AM   #7
Howard Kaikow

 
Joined: Sep 2004
Posts: 489
Kb Entries: 0
Articles: 0
Quote:
 
Originally Posted by: Steiner
Thanks for the tip Juan , but unfortunately I can't yet get it to work with Excel 97 (that does not support Enums ).

I'll try to find a way around that...


I have not looked at Chip's stuff, but I'll make a few comments:

1. It's not hard to get a list of controls, but getting a list of the properties for each control (without going thru a type library) is likely impossible.

2. Unless you have an absolute need to use Excel 97 for a particular reason, you should upgrade to a more recent version of Office if only to be able to use the extra goodies in VB/VBA 6.

Local Time: 04:55 AM
Local Date: 05-25-2013

 
Reply With Quote Top
Old 10-04-2004, 12:22 AM   #8
Steiner

 
Joined: May 2004
Posts: 217
Kb Entries: 13
Articles: 0
I'd like to upgrade, too, but unfortunately that's not my decision...

Local Time: 10:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Old 10-05-2004, 11:28 AM   #9
Juan Pablo Gonz?lez
MS Excel MVP

 
Joined: May 2004
Posts: 30
Kb Entries: 0
Articles: 0
Quote:
 
Originally Posted by: Steiner
Thanks for the tip Juan , but unfortunately I can't yet get it to work with Excel 97 (that does not support Enums ).

I'll try to find a way around that...

Not a huge deal... just need to change all the enums to public constants.


Regards,

Juan Pablo Gonz?lez

Local Time: 03:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Old 10-12-2004, 12:49 AM   #10
Steiner

 
Joined: May 2004
Posts: 217
Kb Entries: 13
Articles: 0
Thank you Juan! I'll try to test / use this as soon as I can look over the pile of work on my desk again which may take a while...

Nevertheless, I'll mark this thread solved.

Local Time: 10:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Old 02-15-2005, 09:03 AM   #11
staffel

 
Joined: Feb 2005
Posts: 3
Kb Entries: 0
Articles: 0
Cool

Do not use

myBox as TextBox

or something like that. Say
myBox as Object

and use the basic (classes/types/properties) to loop through all objects and classes. (parent, class, name, next, text, caption, property, ...) you can hangle through to check all properties of all available and connected objects.

Local Time: 10:55 AM
Local Date: 05-25-2013
Location:

 
Reply With Quote Top
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 02:55 AM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2004 - 2012 VBA Express