Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Wanted: ? UnknownFunction("vbOK") returns 1 in VBE Immediate window

Chip, ran and executed the suggested code. Searching for a solution to
"programmatic access not trusted" led me to your related thread in 2005,
same subject. Downloaded xlConsts2.zip from your site, looks like it
already does what I was interested in doing. Thanks for making it
available!

Best regards,
George


"Chip Pearson" wrote in message
...
IF you have the TypeLib Info DLL installed on your computer, you can
do this. In VBA, go to the Tools menu, choose References, and scroll
down to "TypeLib Info". If that appears in the list, check it. If it
isn't in the list, you probably don't have the required library (email
me for more info). The file name you need to find is TLBINF32.dll.
With the reference in place, you can use code similar to the
following:

Sub AAA()
Dim TLIApp As TLI.TLIApplication
Dim TLITypeLibInfo As TLI.TypeLibInfo
Dim MemInfo As TLI.MemberInfo
Dim EnumName As String
Dim ValueName As String

EnumName = "VBMsgBoxResult"
ValueName = "vbYes"

Set TLIApp = New TLI.TLIApplication
Set TLITypeLibInfo = TLIApp.TypeLibInfoFromFile( _
Filename:=ThisWorkbook.VBProject.References("VBA") .FullPath)
For Each MemInfo In
TLITypeLibInfo.Constants.NamedItem(EnumName).Membe rs
If StrComp(ValueName, MemInfo.Name, vbTextCompare) = 0 Then
Debug.Print "Value Name: " & ValueName & _
" is equal to: " & CStr(MemInfo.Value)
Exit For
End If
Next MemInfo
End Sub

This looks up the string "vbYes" in the "VBMsgBoxResult" enumeration
and returns the numeric value (6) which is assigned to vbYes.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]






On Sat, 13 Feb 2010 14:46:22 -0700, "G Lykos"
wrote:

Thanks!
George



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
c.column returns a number - I need an "A" or "B" or... HH[_3_] Excel Programming 2 January 30th 08 03:49 PM
Wanted: Worksheet Tabs that "mirror" the first few columns of Pre Jack&Jill Excel Discussion (Misc queries) 0 January 4th 08 08:47 PM
Follow link from Window("1") in Window("2") possible? Dennis Excel Programming 1 December 6th 06 04:29 AM
Excel 2003 VBA - "Maximizing" Window & "Calculating" Workbook JingleRock Excel Programming 0 April 25th 06 05:04 AM
freeze window creates multiple "views" suffixed with ":n" dgaex001 Excel Discussion (Misc queries) 5 March 22nd 06 05:28 PM


All times are GMT +1. The time now is 05:21 AM.

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

About Us

"It's about Microsoft Excel"