Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Is it possible (and, if so, how?) to export a certain key, and all its values and (if any) subkeys/values, to an .REG-file? (Just as if you would export from the Registry itself manually) Thanks in advance, CE |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Charlotte,
Have a look here to see if this has what you need... http://www.freevbcode.com/ShowCode.asp?ID=2598 -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I also did some further looking and found the following code samples. I
tested them and it worked just fine 'as is'! Sub RegeditExport(sKey As String, sFilename As String) Shell "regedit.exe /s /e " & Chr(34) & sFilename & Chr(34) & " " & Chr(34) & sKey & Chr(34), vbHide End Sub Sub RegeditImport(sFilename As String) Shell "regedit.exe /s /c " & Chr(34) & sFilename & Chr(34), vbHide End Sub -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stupid, stupid, stupid me!
Of cause - should have thought of that - using Shell and the RegEdit isself as a shortcut :-) Thanks, Garry .-) "GS" wrote in message ... I also did some further looking and found the following code samples. I tested them and it worked just fine 'as is'! Sub RegeditExport(sKey As String, sFilename As String) Shell "regedit.exe /s /e " & Chr(34) & sFilename & Chr(34) & " " & Chr(34) & sKey & Chr(34), vbHide End Sub Sub RegeditImport(sFilename As String) Shell "regedit.exe /s /c " & Chr(34) & sFilename & Chr(34), vbHide End Sub -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stupid, stupid, stupid me!
Of cause - should have thought of that - using Shell and the RegEdit isself as a shortcut :-) Thanks, Garry .-) Not stupid at all! I originally thought you'd need to enum subkeys recursively and build a file string of keys, subkeys, and values as you go. But then I thought there has to be a simpler way, and so I googled. I wasn't aware of the command line switches regedit.exe exposes and so was quite pleased to find the sample. It's really 'clean', IMO. I don't use the Registry at all for my apps because I've configured them to be fully portable so they can run from a memstick. Thus, I use ini/dat files to store settings and other data. I do have (and did use extensively) a similar wrapper (mRegistryAPI.bas) as what I posted the link for, but I seldom use it anymore.<g I have updated it, though, to include these export/import procedures... -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding/changing registry keys | Excel Programming | |||
Registry Keys | Excel Programming | |||
Read Registry Keys (and possibly write) | Excel Programming | |||
How to use Alt keys + symbol keys to invoke a macro? | Excel Programming | |||
Retrieving Registry keys | Excel Programming |