View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.office.developer.vba
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Is there an mso.dll in Office 2003 that is for Office 20077

"Howard Kaikow" wrote in message

Well, not only is the Office12 mso.dll present in my Office 2000, Office
XP
and Office 2003 systems, the Office 11 and Office 10 mso.dll files no
longer
contain references to constants related to the CommandBars object, at
least
forthose constants I am using. Those are now in the Office 12 mso.dll. I
have not checked in Office 9, but the Office 2000 system is different im
that it has no Office9 directory, but it does have an Office 12 directory
with an mso.dll file,


Surely not. As you have VB6 you'll presumably have tlbinf32.dll and should
be able to run this

Sub ListConstants()
' requires tlbinf32.dll is registered on the system
Dim a As Long, i As Long
Dim sFile As String
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

' << change sFile to suit
'sFile = Application.Path & "\Excel.exe"
'sFile = ThisWorkbook.VBProject.References("OFFICE").FullPa th ' "VBA"
etc
sFile = "C:\Program Files\Common Files\Microsoft
Shared\OFFICE12\MSO.DLL"

On Error Resume Next
Set XLInfo = TLIApp.TypeLibInfoFromFile(sFile)
On Error GoTo 0
If XLInfo Is Nothing Then
MsgBox "file not found or registered" & vbCr & sFile
Exit Sub
End If

Columns("A:D").Clear
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
Cells(a, 4) = "H " & Hex(CLng(m(i).Value))
Next
Next
Columns("A:D").EntireColumn.AutoFit
End Sub

Regards,
Peter T