![]() |
excel macro code in registry
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 |
excel macro code in registry
one writes to the ini file and the other reads from the ini file.
Here is some more information: (URL recently posted by Harald Staff) http://freespace.virgin.net/s.cowan/.../ini_files.htm -- Regards, Tom Ogilvy "Jorge" wrote in message ... 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 |
All times are GMT +1. The time now is 02:44 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com