473,473 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Excel.inc?

Hi, is there somewhere a file that holds constants for Excel Automation
ActiveX objects, such as adovbs.inc for ADO constants?

Thx
Jul 19 '05 #1
2 1866
Agoston Bejo wrote:
Hi, is there somewhere a file that holds constants for Excel Automation
ActiveX objects, such as adovbs.inc for ADO constants?


Download and install Mark Pryor's TLViewer utility and you can create
your own include files for COM objects.

http://mysite.verizon.net/res1ur2j/tlviewer.htm

--
Steve

Absolute faith corrupts as absolutely as absolute power. -Eric Hoffer
Jul 19 '05 #2
19.08.2004 11:01, Agoston Bejo schrieb:
Hi, is there somewhere a file that holds constants for Excel Automation
ActiveX objects, such as adovbs.inc for ADO constants?


You could extract the constants from the typelib and write them
to file:
Option Explicit

Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")

'Creates two IncludeFiles
CreateIncludeFile "Excel.Application", "vbs", "C:\xlsConsts.vbs", true
CreateIncludeFile "Excel.Application", "js", "C:\xlsConsts.js", true

Sub CreateIncludeFile (sProgID, scrID, sOutFile, bShowImmediate)
Dim strConsts
strConsts = ReturnTlbEnumsFromProgId (sProgID, scrID)
fs.CreateTextFile(sOutFile, true, 0).Write strConsts
If bShowImmediate Then CreateObject("WScript.Shell").Run "notepad " & sOutFile
End Sub

Function ReturnTlbEnumsFromProgId (sProgId, scrID)
'Thx Alex ;-)
Dim TLA, TLI, CstEnum, CstObj, CstString, CoCls, vCst, vEndl, vCmt
Set CoCls = CreateObject(sProgId)
Set TLA = CreateObject("TLI.TLIApplication")
Set TLI = TLA.InterfaceInfoFromObject(CoCls).Parent
Call getLangParams (scrID, vCst, vEndl, vCmt)
CstString = BuildIntro (sProgId, TLI.ContainingFile, vCmt)
For each CstEnum in TLI.Constants
If "_" <> Left(CstEnum.Name, 1) Then
CstString = CstString & vbCrlf & vCmt & CstEnum.Name & vbCrlf
For Each CstObj In CstEnum.Members
CstString = CstString & vCst & " " & CstObj.Name _
& " = " & CstObj.Value & vEndl & vbCrLf
Next
End If
Next
ReturnTlbEnumsFromProgId = CstString
End Function

Sub getLangParams (ByVal scrID, ByRef vCst, ByRef vEndl, ByRef vCmt)
Select Case LCase(scrID)
Case "vbs", "vbscript":
vCst = "Const" : vEndl = "" : vCmt = "'"
Case "js", "jscript":
vCst = "var" : vEndl = ";" : vCmt = "//"
Case Else
vCst = "" : vEndl = "" : vCmt = ""
End Select
End Sub

Function BuildIntro (sProgId, srv, vCmt)
BuildIntro = vCmt & String (60, "*") & vbCrLf _
& vCmt & "Enumerated Constants for CoClass """ & sProgID & """" & vbCrLf _
& vCmt & "Extracted from """ & srv & """" & vbCrLf _
& vCmt & String (60, "*") & vbCrLf
End Function
--
Gruesse, Christoph

Rio Riay Riayo - Gordon Sumner, 1979

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
3
by: Otie | last post by:
I found the following under the GetObject help notes and in the example for GetObject: "This example uses the GetObject function to get a reference to a specific Microsoft Excel worksheet...
6
by: Matthew Wieder | last post by:
I have the following requirements: Build a stand-alone C# application that asks the user to click in a cell in an Excel spreadsheet, and then displays the address of that cell in the C#...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
22
by: Howard Kaikow | last post by:
There's a significant problem in automating Excel from VB .NET. Reminds me of a problem I encountered almost 3 years ago that was caused by the Norton Auntie Virus Office plug-in. Can anybody...
9
by: Anthony | last post by:
To me, creating Excel 2003 spreadsheets programmatically via VB.NET hasn't really changed since the days of VB6. That is, I'd do something similar to this Code: Dim ExcelApp As...
7
by: Alain \Mbuna\ | last post by:
Hi everybody. In my program I have some data that is calculated after some input from the user. I have written some code that opens an Excel workbook, with 5 worksheets and the calculated data...
16
by: alexia.bee | last post by:
Hi all, In some weird reason, excel instance won;t die if i remove the comment from 4 lines of setting values into struct. here is a snipcode public...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.