Excel Automation - Constants - Studio 3.2.1

Michael Seall ms at smartrack.co.uk
Wed May 21 04:14:48 EDT 2008


Hi Phil

My code is :
Do $root.$extobjects.Automation Library.$objects.$makelist($ref.$name()) 
Returns lAutomationList
Do 
lAutomationList.$search(mid($ref.C1,1,17)='Excel.Application',kTrue,kFalse,kTrue,kTrue)
Do lAutomationList.$remove(kListKeepSelected)
If lAutomationList.$linecount()>0
Do lAutomationList.$sort($ref.C1,kFalse)
Calculate test as con('.AutomationLibrary.Automation\',lAutomationList.1.C1)
Do lRow.$cols.$add('excel',kObject,con('.Automation 
Library.Automation\',lAutomationList.1.C1))
Calculate locExcelObj as lRow.excel
Else
Calculate locExcelObj as ''
Quit method kFalse
End If

Do locExcelObj.$createobject() Returns #1

. . . . . . . .  which I think is pretty much similar. In other words, it 
does create the object. I'm assuming that I should see the constant under 
the Automation Category, but it is still not there. Should I be looking in a 
different category?

I'm guessing I probably need to find the numeric value of the constant as 
Kelly suggests.

Your help is much appreciated

Michael




----- Original Message ----- 
From: "Phil Potter" <nospam at pgpotter.demon.co.uk>
To: <omnisdev-en at lists.omnis-dev.com>
Sent: Tuesday, May 20, 2008 5:26 PM
Subject: Re: Excel Automation - Constants - Studio 3.2.1


> Hi Michael,
>
> When created, the constants tab will have Excel entries...
>
> I have Excel.Application.12 for my MSoffice 2007 version.
> Think it was 11 for Office 2003
>
> I create the object like this:
>
> ###
> Do $root.$extobjects.Automation Library.$objects.$makelist($ref.$name) 
> Returns llList
> Do llList.$sort($ref.C1,kTrue)
> Do 
> llList.$search(mid($ref.C1,1,17)='Excel.Application',kTrue,kFalse,kTrue,k
> True)
> Do llList.$remove(kListKeepSelected)
> Do llList.$line.$assign(llList.$linecount)
>
> Do lrCreateObject.$define()
> Do lrCreateObject.$cols.$add('ExtObj',kObject,con('.Automation 
> Library.Automation\',llList.C1),0)
> Calculate loExcel as lrCreateObject.ExtObj
> ###
>
> hope this helps
> Phil.
>
>
> Michael Seall <ms at smartrack.co.uk> wrote
>>Thanks for responding Phil.
>>
>>I have created  my Excel object. I have not assigned any Subtype to it, 
>>but neither of these constants appear in the catalog under Automation 
>>Library. I'm assuming that is the right category.
>>
>>When I just type the constants in, it says that it is an Unrecognisable 
>>variable name etc. Must be missing something.
>>
>>Michael
>>
>>
>>----- Original Message ----- From: "Phil Potter" 
>><nospam at pgpotter.demon.co.uk>
>>To: <omnisdev-en at lists.omnis-dev.com>
>>Sent: Tuesday, May 20, 2008 4:03 PM
>>Subject: Re: Excel Automation - Constants - Studio 3.2.1
>>
>>
>>> Michael,
>>>
>>> After you have created an excel object, these constants can be found in 
>>> the catalog, under constants...
>>>
>>> The main point here is 'after' you have created an excel object.
>>>
>>> Regards
>>> Phil.
>>>
>>> Michael Seall <ms at smartrack.co.uk> wrote
>>>>Looking through the archives for last year and I note that Phil Potter 
>>>>suggested using kAutoxlShiftDown and kAutoxlFormatFromLeftOrAbove to 
>>>>insert a row.
>>>>
>>>>Where do you get these constants from because I can't find them anywhere 
>>>>in 3.2.1 or 4.3? Is there some special hiding place for stuff like this? 
>>>>I have set the object to Automation/Excel Worksheet. That doesn't seem 
>>>>to do anything. What am I missing?
>>>>
>>>>Best regards
>>>>
>>>>Michael
>>>
>>> --
>>> =============================================
>>> from: Phil Potter <phil at pgpotter.demon.co.uk>
>>> =============================================
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>
>>_____________________________________________________________
>>Manage your list subscriptions at http://lists.omnis-dev.com
>>No virus found in this incoming message.
>>Checked by AVG.
>>Version: 8.0.100 / Virus Database: 269.23.21/1456 - Release Date: 
>>20/05/2008 06:45
>
> -- 
> =============================================
> from: Phil Potter <phil at pgpotter.demon.co.uk>
> =============================================
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com 




More information about the omnisdev-en mailing list