excel macro code in registry

  • Thread starter Thread starter Jorge
  • Start date Start date
J

Jorge

Hi,

Situation: I am trying to write a excel macro code using
my INI file as an input file and write it to Registry and
my VBA application updates some of its content and then
save it back to my INI file.

Question: Is it safe to use Registry for my INI variables?

My friend told me it is a good idea to use the following
code:
Public Declare Function GetPrivateProfileString
Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal
lpApplicationName As String, ByVal lpKeyName As Any, ByVal
lpDefault As String, ByVal lpReturnedString As String,
ByVal nSize As Long, ByVal lpFileName As String) As Long

Public Declare Function WritePrivateProfileString
Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal
lpApplicationName As String, ByVal lpKeyName As Any, ByVal
lpString As Any, ByVal lpFileName As String) As Long

Can anybody advice me which is the better one.

Thanks in advance.
Jorge
 
Back
Top