Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Excel 2007 cannot open Excel 2003 documents. Registry Policy Setti Gordon Gecko Setting up and Configuration of Excel 0 March 4th 09 02:19 AM
Registry policy for older Excel documents Gary Excel Discussion (Misc queries) 1 June 19th 08 01:45 PM
Subtotal fix for excel 2003 updated registry-now another problem Laura Excel Discussion (Misc queries) 0 October 17th 07 06:49 PM
Unable to find registry key for MS-Excel 2003 setting Marcel Bruinsma Setting up and Configuration of Excel 0 September 21st 05 09:35 AM


All times are GMT +1. The time now is 01:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"