[AccessD] Pulling Data from Excel into Access with "Automation"

Stuart McLachlan stuart at lexacorp.com.pg
Thu Jun 30 18:13:24 CDT 2011


I hate to sound like a broken record but, PowerBasic comes with a COM browser tool which 
extracts all of the details from COM object models including equates, interfaces etc.  You can 
use it to copy/paste equates into VBA so that your automation code isn't full of "magic 
numbers".   It describes the full object model so you have all the method and property names 
avaiable as well.

AFAIAC,  that tool alone is worth the whole $200 that PB/Win costs. :-)
  
Sample extractions

AN INTERFACE:
' Interface Name  : Workbook
' This Interface cannot be created directly it can only
' be returned by a Method or Property in this library. 
Interface IDBind Workbook
    Member Call Activate <304> () As Variant
    Member Call Application <148> () As Variant
    Member Call BuiltinDocumentProperties <1176> (In Index As Variant<0>) As Variant
...
    Member Get ActiveChart <183> () As Variant
    Member Let ActiveChart <183> ()
    Member Get ActiveSheet <307> () As Variant
    Member Let ActiveSheet <307> ()

SOME EQUATES:
    xlA1 = 1
    xl4DigitYears = 43
    xl3DSurface = -4103
    xl3DPie = -4102
    xl3DLine = -4101
    xl3DEffects2 = 14
    xl3DEffects1 = 13
    xl3DColumn = -4100
    xl3DBar = -4099
    xl3DArea = -4098
    xl24HourClock = 33



On 30 Jun 2011 at 18:42, William Benson (VBACreations. wrote:

> Caveats:  Methods like Union ()  need xl.Union to be invokable. Same
> with Intersection, and Selection. It's hard to remember this. Trust
> me. Painful. If you use late binding you need values for all intrinsic
> constants. You also have to watch out for version changes and the
> impact on intrinsic constants.
> 
  




More information about the AccessD mailing list