Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel OLE Automation: How to access constants ?

Hi,

I am doing some Excel OLE Automation, but I can't find out how to access the
constants.

Let's say I want to use the Range("C65536").End(xlUp) to find the last cell
in a column.

The problem is my program always fails because the constant xlUp is not
defined.

Is there any way to access those constants through the COM interface ?

Thank you very much !

PS: I am using this interface in PHP and JScript so far, but I think the
answer to my question should be applicable to any language using the COM
interface.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Excel OLE Automation: How to access constants ?

The normal approach is to either substitute the numeric values or to define
the constants in your script.
I'm not aware of any other method (but someone else may be...)

Tim

"SDelroen" wrote in message
...
Hi,

I am doing some Excel OLE Automation, but I can't find out how to access
the
constants.

Let's say I want to use the Range("C65536").End(xlUp) to find the last
cell
in a column.

The problem is my program always fails because the constant xlUp is not
defined.

Is there any way to access those constants through the COM interface ?

Thank you very much !

PS: I am using this interface in PHP and JScript so far, but I think the
answer to my question should be applicable to any language using the COM
interface.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Excel OLE Automation: How to access constants ?

Or this might help:

http://forums.aspfree.com/code-bank-...ns-102514.html

Tim

"Tim Williams" wrote in message
...
The normal approach is to either substitute the numeric values or to
define the constants in your script.
I'm not aware of any other method (but someone else may be...)

Tim

"SDelroen" wrote in message
...
Hi,

I am doing some Excel OLE Automation, but I can't find out how to access
the
constants.

Let's say I want to use the Range("C65536").End(xlUp) to find the last
cell
in a column.

The problem is my program always fails because the constant xlUp is not
defined.

Is there any way to access those constants through the COM interface ?

Thank you very much !

PS: I am using this interface in PHP and JScript so far, but I think the
answer to my question should be applicable to any language using the COM
interface.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Excel OLE Automation: How to access constants ?

That's not quite VBA but does need tlbinf32.dll to be installed with
Regsrv32. But if it exists in the system this will be easier in Excel.

For early binding (with Intellisense etc) set a reference to "TypeLib
Information" and replace all the "As Object", otherwise late binding should
work fine.

Sub ListConstants()
' requires tlbinf32.dll is registered on the system
Dim a As Long, i As Long
Dim TLIApp As Object 'TLI.TLIApplication
Dim XLInfo As Object 'TLI.TypeLibInfo
Dim c As Object 'ConstantInfo
Dim m As Object 'Members

'Set TLIApp = New TLI.TLIApplication ' early binding
Set TLIApp = CreateObject("TLI.TLIApplication") ' late binding

Set XLInfo = TLIApp.TypeLibInfoFromFile(Application.Path & "\Excel.exe")

For Each c In XLInfo.Constants
a = a + 1
Cells(a, 1) = c.Name
Set m = c.Members
For i = 1 To m.Count
a = a + 1
Cells(a, 2) = m(i).Name
Cells(a, 3) = m(i).Value
Next
Next

End Sub

Keep in mind each Excel version has some new constants.

Regards,
Peter T

"Tim Williams" wrote in message
...
Or this might help:

http://forums.aspfree.com/code-bank-...ns-102514.html

Tim

"Tim Williams" wrote in message
...
The normal approach is to either substitute the numeric values or to
define the constants in your script.
I'm not aware of any other method (but someone else may be...)

Tim

"SDelroen" wrote in message
...
Hi,

I am doing some Excel OLE Automation, but I can't find out how to access
the
constants.

Let's say I want to use the Range("C65536").End(xlUp) to find the last
cell
in a column.

The problem is my program always fails because the constant xlUp is not
defined.

Is there any way to access those constants through the COM interface ?

Thank you very much !

PS: I am using this interface in PHP and JScript so far, but I think the
answer to my question should be applicable to any language using the COM
interface.







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automation excel to access goaljohnbill Excel Programming 1 May 21st 09 05:25 AM
automation from access into excel SAm Excel Discussion (Misc queries) 7 January 27th 06 02:49 AM
Access automation from Excel AccessChallenged Excel Programming 2 December 31st 03 06:29 PM
Automation from .pdb to excel and then to access Kenny chan Excel Programming 1 December 13th 03 01:28 AM
Automation Excel & Access GarethG Excel Programming 6 October 3rd 03 09:14 AM


All times are GMT +1. The time now is 07:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"