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

William Benson (VBACreations.Com) vbacreations at gmail.com
Thu Jun 30 20:53:22 CDT 2011


Not to take away from your point about power basic (tho I have not used it)
... As far as I know, there are no "magic numbers" numbers with a reference
to Excel, only when using late binding... I still get intellisense when I
declare objects as what they are.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Thursday, June 30, 2011 7:13 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Pulling Data from Excel into Access with "Automation"

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.
> 
  

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list