Registry setting for Excel File

dnd
06-05-2003, 09:13 AM
Hi

does anyone know how I can write to the registry in excel so that I
could set up a counter on an excel file have, so say users can only open
the file say 5 times?
All I reallly know is that the Information used by Excel 2000 is stored in

HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel

And VBA GetSettings and SaveSettings functions work only with the following key name:

HKEY_CURRENT_USER\Software\VB and VBA Program Settings

I was unable to add a file to this post. .



Regards,
David

PWNettle
06-05-2003, 10:26 AM
I can't imagine why you'd want to do this, but I don't need to know!

You could use GetSetting and SaveSetting to do it. They both allow you to specify parameters that *could* be used to share a registry location.

HKEY_CURRENT_USER\Software\VB and VBA Program Settings

...is just part of the path where VB/VBA stores registry settings with GetSetting/SaveSetting...the rest of the path is based on parameters supplied with the functions.

If you read the documentation on them, you see that you provide an application name, section name, and key name when you use them (app name and section name help define the registry path)...so all you'd need to do is use the same names whenever you wanted to increment/decrement your counter.

The trick will be placing your increment/decrement code in the right place to get the count actions happening at the right time.

Paul

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum