Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Writing to the Registry

Hi All,

I'm developing an application which will be used on a company network. I am
saving and retrieving settings to the registry, now by default the
SaveSettings saves the settings to the CurrentUser section of the registry,
does that mean that every computer on the network will save and retrieve
different settings? In this application I need that at least some of the
vsettings should be the same for each user and others should be user based,
is there a way with VBA to save the settings so that all computers get the
same values?
--
A. Ch. Eirinberg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Writing to the Registry

Generally speaking, everything in the registry is local to the
machine, and if there are multiple user accounts on a single machine,
each user account will have a separate HKEY_CURRENT_USER region.

Basic application data, items over which the user has no control via
your program, are typically stored in HKEY_LOCAL_MACHINE. Any option
that the use has control of, and that two users may want different
values for, should go in HKEY_CURRENT_USER.

If you are using GetSetting and SaveSetting, those values are stored
in HKEY_CURRENT_USER so each user will have his own set of values and
one user cannot see the values of another user. These values cannot be
shared amongst users.

This is all local to one machine. If you need to store configuration
values to be used by all users on all machines connected to your
network, you can use text-based configuration files (e.g., ini text
files, or, better, XML files). At startup, the application would
connect to the network, read the configuration data out of the data
store on the server (text, xml, perhaps even a database) and act
accordingly to the values of the config data.

I have an ActiveX DLL that wraps up all the various registry-related
API functions into a nice neat VBA-friendly set of functions. You can
get more details and a download at
http://www.cpearson.com/excel/registryworx.aspx.

RegistryWorx allows you to work with any hive (CURRENT_USER,
CLASSES_ROOT, LOCAL_MACHINE) and any key contained therein. However,
it does not support remote registry access (yet). Send me an email if
you want the VB6 source code for the DLL.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Sun, 21 Dec 2008 15:29:00 -0800, Howard31
wrote:

Hi All,

I'm developing an application which will be used on a company network. I am
saving and retrieving settings to the registry, now by default the
SaveSettings saves the settings to the CurrentUser section of the registry,
does that mean that every computer on the network will save and retrieve
different settings? In this application I need that at least some of the
vsettings should be the same for each user and others should be user based,
is there a way with VBA to save the settings so that all computers get the
same values?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Writing to the Registry

Thanks Chip for responding to my question,

Will it be possible for you just to give me the API calls and how to use
them? I understand that It's not that freindly and your thing that you made
with VB6 will be easier to use , but I and my clients don't have VB6 we only
have Excel and the VBA that comes with it.

Thanks again,
--
A. Ch. Eirinberg


"Chip Pearson" wrote:

Generally speaking, everything in the registry is local to the
machine, and if there are multiple user accounts on a single machine,
each user account will have a separate HKEY_CURRENT_USER region.

Basic application data, items over which the user has no control via
your program, are typically stored in HKEY_LOCAL_MACHINE. Any option
that the use has control of, and that two users may want different
values for, should go in HKEY_CURRENT_USER.

If you are using GetSetting and SaveSetting, those values are stored
in HKEY_CURRENT_USER so each user will have his own set of values and
one user cannot see the values of another user. These values cannot be
shared amongst users.

This is all local to one machine. If you need to store configuration
values to be used by all users on all machines connected to your
network, you can use text-based configuration files (e.g., ini text
files, or, better, XML files). At startup, the application would
connect to the network, read the configuration data out of the data
store on the server (text, xml, perhaps even a database) and act
accordingly to the values of the config data.

I have an ActiveX DLL that wraps up all the various registry-related
API functions into a nice neat VBA-friendly set of functions. You can
get more details and a download at
http://www.cpearson.com/excel/registryworx.aspx.

RegistryWorx allows you to work with any hive (CURRENT_USER,
CLASSES_ROOT, LOCAL_MACHINE) and any key contained therein. However,
it does not support remote registry access (yet). Send me an email if
you want the VB6 source code for the DLL.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Sun, 21 Dec 2008 15:29:00 -0800, Howard31
wrote:

Hi All,

I'm developing an application which will be used on a company network. I am
saving and retrieving settings to the registry, now by default the
SaveSettings saves the settings to the CurrentUser section of the registry,
does that mean that every computer on the network will save and retrieve
different settings? In this application I need that at least some of the
vsettings should be the same for each user and others should be user based,
is there a way with VBA to save the settings so that all computers get the
same values?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Writing to the Registry

Howard,

Although the RegistryWorx.dll component was written in Visual Basic 6,
it is not necessary to have VB6 installed in order to use the
component. If you download the component and unzip it into some
folder, all you need to do is register the component with Windows. Go
to the Windows Start menu, choose Run, and enter the following and
click OK:

RegSvr32 "C:\Your Path\RegistryWorx.dll"

Of course, change "Your Path" to the complete file name of the
RegistryWorx.dll file. If you distribute a workbook that uses the
RegistryWorx component, you'll have to distribute that component with
the workbook and register it on the other machine. In this case, it is
best just to distribute the Setup.exe program and let the users
install that. Setup.exe automatically registers the component, so it
is not necessary to do the RegSvr32 step.

With the component registered, you can reference the component in VBA.
In the VBA Editor, go to the Tools menu, choose References, and scroll
down to Registry Worx. Check this item.

All that said, I have put a zip file up on my web site that has the
complete VB6 project and source files. Download

http://www.cpearson.com/Zips/HowardRegWorx.ziip .

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Mon, 22 Dec 2008 06:02:01 -0800, Howard31
wrote:

Thanks Chip for responding to my question,

Will it be possible for you just to give me the API calls and how to use
them? I understand that It's not that freindly and your thing that you made
with VB6 will be easier to use , but I and my clients don't have VB6 we only
have Excel and the VBA that comes with it.

Thanks again,

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Writing to the Registry

Thanks very much Chip,

I'll try it later.

Your advice is very much appreciated.
--
A. Ch. Eirinberg


"Chip Pearson" wrote:

Howard,

Although the RegistryWorx.dll component was written in Visual Basic 6,
it is not necessary to have VB6 installed in order to use the
component. If you download the component and unzip it into some
folder, all you need to do is register the component with Windows. Go
to the Windows Start menu, choose Run, and enter the following and
click OK:

RegSvr32 "C:\Your Path\RegistryWorx.dll"

Of course, change "Your Path" to the complete file name of the
RegistryWorx.dll file. If you distribute a workbook that uses the
RegistryWorx component, you'll have to distribute that component with
the workbook and register it on the other machine. In this case, it is
best just to distribute the Setup.exe program and let the users
install that. Setup.exe automatically registers the component, so it
is not necessary to do the RegSvr32 step.

With the component registered, you can reference the component in VBA.
In the VBA Editor, go to the Tools menu, choose References, and scroll
down to Registry Worx. Check this item.

All that said, I have put a zip file up on my web site that has the
complete VB6 project and source files. Download

http://www.cpearson.com/Zips/HowardRegWorx.ziip .

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Mon, 22 Dec 2008 06:02:01 -0800, Howard31
wrote:

Thanks Chip for responding to my question,

Will it be possible for you just to give me the API calls and how to use
them? I understand that It's not that freindly and your thing that you made
with VB6 will be easier to use , but I and my clients don't have VB6 we only
have Excel and the VBA that comes with it.

Thanks again,




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
Registry compare Lillian Lian Excel Programming 4 May 31st 07 07:25 PM
Value from Registry Roy Lasris Excel Programming 3 February 23rd 04 11:53 PM
System Registry Darryl Bailey Excel Programming 3 October 10th 03 03:47 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 02:43 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"