How to know the excel's constant

  • Thread starter Thread starter Hidayat
  • Start date Start date
H

Hidayat

Hi Expert,
Does anyone know the value of the Excel constants such as
xlDiagonal, xlEdgeBottom etc. How to get that's value..?
please advice
Thanks for advices
Hidayat
 
Hi Hidayat

Or you could do a keyword search in the help for constants or write

msgbox(constant_name) in a macro = this shows xlDialogZoom as 256....


Regards

David
 
Hi Hidayat,

Try the Object Browser within the VBE.

From Excel use ALT+F11 to display the VBE (visual basic editor)
The F2 to display the object browser.

You can then use the search function within the Object Browser.
Hi Expert,
Does anyone know the value of the Excel constants such as
xlDiagonal, xlEdgeBottom etc. How to get that's value..?
please advice
Thanks for advices
Hidayat

--

Cheers
Andy

http://www.andypope.info
 
Hidayat,

I have a little utility that will print out the constants and their values
on a separate worksheet, which you sort, print etc.

It caters for Outlook, Word, Excel, PowerPoint, Access 2000 and 2002. All
you need to do is plug in the Office directory (probably c:\Program
Files\Microsoft Office\Office) and you are away.

Mail me direct if you want a copy.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
You can try:
' From the Project menu, select References, and set a reference to
tlbinf32.dll
Sub OfficeConstantsList()
Const OfficeApp As String = "C:\Program Files\Microsoft
Office\Office10\excel.exe"
Dim x As TypeLibInfo, r, mbr, i As Long
On Error Resume Next
Cells.ClearContents
Set x = TypeLibInfoFromFile(OfficeApp)
For Each r In x.Constants
For Each mbr In r.Members
i = i + 1
Cells(i, 1) = mbr.Name
Cells(i, 2) = mbr.Value
Next mbr
Next r
Set x = Nothing
Columns("A:A").Columns.AutoFit
End Sub

MP
 
Can't find the tlbinf32.dll. Help

Greg
Michel Pierron said:
You can try:
' From the Project menu, select References, and set a reference to
tlbinf32.dll
Sub OfficeConstantsList()
Const OfficeApp As String = "C:\Program Files\Microsoft
Office\Office10\excel.exe"
Dim x As TypeLibInfo, r, mbr, i As Long
On Error Resume Next
Cells.ClearContents
Set x = TypeLibInfoFromFile(OfficeApp)
For Each r In x.Constants
For Each mbr In r.Members
i = i + 1
Cells(i, 1) = mbr.Name
Cells(i, 2) = mbr.Value
Next mbr
Next r
Set x = Nothing
Columns("A:A").Columns.AutoFit
End Sub

MP
 
Hi Greg;
In the references list, if you see TypeLib Information, it is the same
thing.
MP
 
Hi Greg; test with this procedure, no reference is necessary:
Sub OfficeConstantsList()
Application.ScreenUpdating = False
Dim R, Member, i As Long, oPath As String
oPath = Application.Path & "\excel.exe"
With CreateObject("TLI.typelibinfo")
.ContainingFile = oPath
Workbooks.Add
For Each R In .Constants
i = i + 1
Cells(i, 1) = R.Name: Cells(i, 1).Font.Bold = True
Cells(i, 2) = "Value": Cells(i, 2).Font.Bold = True
Cells(i, 2).HorizontalAlignment = xlRight
For Each Member In R.Members
i = i + 1
Cells(i, 1) = Member.Name
Cells(i, 2) = Member.Value
Next Member
Next R
End With
Columns("A:B").Columns.AutoFit
Range("A2").Select
ActiveWindow.FreezePanes = True
Range("A1").Select
End Sub

MP
 
Michael, thank you very much.

Greg
Michel Pierron said:
Hi Greg; test with this procedure, no reference is necessary:
Sub OfficeConstantsList()
Application.ScreenUpdating = False
Dim R, Member, i As Long, oPath As String
oPath = Application.Path & "\excel.exe"
With CreateObject("TLI.typelibinfo")
.ContainingFile = oPath
Workbooks.Add
For Each R In .Constants
i = i + 1
Cells(i, 1) = R.Name: Cells(i, 1).Font.Bold = True
Cells(i, 2) = "Value": Cells(i, 2).Font.Bold = True
Cells(i, 2).HorizontalAlignment = xlRight
For Each Member In R.Members
i = i + 1
Cells(i, 1) = Member.Name
Cells(i, 2) = Member.Value
Next Member
Next R
End With
Columns("A:B").Columns.AutoFit
Range("A2").Select
ActiveWindow.FreezePanes = True
Range("A1").Select
End Sub

MP

message
 
Back
Top