Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 cannot open Excel 2003 documents. Registry Policy Setti | Setting up and Configuration of Excel | |||
Registry policy for older Excel documents | Excel Discussion (Misc queries) | |||
Subtotal fix for excel 2003 updated registry-now another problem | Excel Discussion (Misc queries) | |||
Unable to find registry key for MS-Excel 2003 setting | Setting up and Configuration of Excel |