Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there an Excel VBA board? I cannot find it. May I post this here please?
In Word, it is easy to get a registry entry using the following formula: I have set a value via Word to the registry key: HKEY_LOCAL_MACHINE\Software\SECTIONNAME", "ENTRYNAME") How can I read it in Excel? I tried the formula suggested by the Help system under "Registry" and came up with the following, but it doesn't work: ValueIs = GetSetting(AppName:="MyApp", Section:= _ "HKEY_LOCAL_MACHINE\Software\SECTIONNAME", key:="ENTRYNAME") What am I doing wrong? Thanks, Roy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Roy
Is there an Excel VBA board This is the good one Try this HOWTO: Use the Windows Script Host to Read, Write, and Delete Registry Keys http://support.microsoft.com/default...;EN-US;Q244675 I make this one some time back, maybe it is useful for you Sub GetKeyValue() Dim Shell As Object Dim keyname As String Dim valuename As String Dim keyvalue As Integer keyname = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\ Outlook\Options\Mail\" valuename = "Send Mail Immediately" Set Shell = CreateObject("wscript.shell") On Error Resume Next keyvalue = Shell.regread(keyname & valuename) If Err.Number < 0 Then MsgBox "Invalid Registry Entry" Else MsgBox keyvalue End If End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Roy Lasris" wrote in message ... Is there an Excel VBA board? I cannot find it. May I post this here please? In Word, it is easy to get a registry entry using the following formula: I have set a value via Word to the registry key: HKEY_LOCAL_MACHINE\Software\SECTIONNAME", "ENTRYNAME") How can I read it in Excel? I tried the formula suggested by the Help system under "Registry" and came up with the following, but it doesn't work: ValueIs = GetSetting(AppName:="MyApp", Section:= _ "HKEY_LOCAL_MACHINE\Software\SECTIONNAME", key:="ENTRYNAME") What am I doing wrong? Thanks, Roy |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ron,
Thanks. It worked fine, except since my values were strings and not integers, I had to change the keyvalue dim to string and the comparison at the bottom to "" not "0". Thanks for your help. Roy |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Roy,
Programming is the VBA board. Excel VBA also has GetSetting and SaveSetting. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Roy Lasris" wrote in message ... Is there an Excel VBA board? I cannot find it. May I post this here please? In Word, it is easy to get a registry entry using the following formula: I have set a value via Word to the registry key: HKEY_LOCAL_MACHINE\Software\SECTIONNAME", "ENTRYNAME") How can I read it in Excel? I tried the formula suggested by the Help system under "Registry" and came up with the following, but it doesn't work: ValueIs = GetSetting(AppName:="MyApp", Section:= _ "HKEY_LOCAL_MACHINE\Software\SECTIONNAME", key:="ENTRYNAME") What am I doing wrong? Thanks, Roy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Managing add-ins via the registry | Setting up and Configuration of Excel | |||
System Registry | Excel Programming | |||
Registry | Excel Programming | |||
Registry | Excel Programming |