Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could use an INI file.
Private Declare Function GetPrivateProfileInt Lib "kernel32" _ Alias "GetPrivateProfileIntA" _ (ByVal lpApplicationName As String, _ ByVal lpKeyName As String, _ ByVal nDefault As Long, _ ByVal lpFileName As String) As Long Private 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 Private 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 and use like so cSubItems = GetPrivateProfileInt("myApp", "Id", 0, Filename) and Dim sKeyValue As String Dim nLen As Long sKeyValue = Space$(255) nLen = GetPrivateProfileString(AppId, "myApp", "Id", "Not Found", _ sKeyValue, Len(sKeyValue), Filename) If nLen = Len(sKeyValue) - 1 Then 'means sKeyValue not long enough sKeyValue = Space$(Len(sKeyValue) + 100) Else sKeyValue = Left(sKeyValue, nLen) End If -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Eric" wrote in message ... Hi, I am writing an add-in and one of its first duty should be to be able to read a "config file" containing several settings necessary to the other procedures in the add-in. Another procedure in the add-in will also allow the user to change and save new settings into this same config file. I really don't know where to start? How would you go about it? Thank you. Eric |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Converting "uppercase" string data to "lower case" in CSV file | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F | Excel Discussion (Misc queries) | |||
Problem- Recording macros for "file save" and "File open" | Excel Programming | |||
"Headroom" on <Files=99 in config.sys | Excel Programming |