LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Reading the Registry

Here is an example

Dim oWSH As Object
Dim sResult

Set oWSH = CreateObject("WScript.Shell")


On Error Resume Next

sResult = oWSH.RegRead("HKCU\Software\myApp\myKey\")
If Err.Number < 0 Or sResult = "" Then
MsgBox "No valid key"
Me.Close savechanges:=False
End If
Err.Clear

On Error GoTo 0



--

HTH

RP
(remove nothere from the email address if mailing direct)


"JK" wrote in message news:4OpWd.25746$QQ3.1671@trnddc02...
I would like my application to read the registry each time it opens to
confirm that "HKEY_CURRENT_USER\Software\[my application]\[my RegEntry]
exists. I read JW's explanation but am struggling to make it fit my

purpose:
If [my RegEntry] exists, then open application, else MsgBox "Sorry" close
application. Can someone please advise.

Thank you.
Jim Kobzeff




 
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
Value from Registry Roy Lasris Excel Programming 3 February 23rd 04 11:53 PM
Reading the Registry - CSV Download Flag Tim Childs[_6_] Excel Programming 6 December 10th 03 10:39 PM
Confirm Open After Download - Reading Registry Tim Childs[_6_] Excel Programming 3 November 30th 03 05:31 PM
Registry Tom Ogilvy Excel Programming 1 July 16th 03 01:02 AM
Registry Patrick Molloy[_4_] Excel Programming 0 July 15th 03 12:45 PM


All times are GMT +1. The time now is 04:26 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"