Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading from ini file
I need to create a macro in Excel which reads from an ini file. Word
uses the system.privateprofilestring but I can't find anything like this in Excel. Any suggestions greatly appreciated! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading from ini file
Tammy, :)
Because an ini file is just a text file, it can be read with Ope statment. Code ------------------- Sub test() Dim fn As Long Dim tmp As String fn = FreeFile 'Change here to the file path Open "c:\test.ini" For Input As fn Do While Not EOF(fn) Line Input #fn, tmp Debug.Print tmp Loop Close fn End Sub ------------------- -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading from ini file
Tammy,
In Excel you have to use the GetPrivateProfileString, WritePrivateProfileString APIs, so requires much more coding. I have a demo somewhere (using CDPlayer.ini), would you like me to dig it out? -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Tammy" wrote in message om... I need to create a macro in Excel which reads from an ini file. Word uses the system.privateprofilestring but I can't find anything like this in Excel. Any suggestions greatly appreciated! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading from ini file
That would be great! Thanks Bob.
"Bob Phillips" wrote in message ... Tammy, In Excel you have to use the GetPrivateProfileString, WritePrivateProfileString APIs, so requires much more coding. I have a demo somewhere (using CDPlayer.ini), would you like me to dig it out? -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Tammy" wrote in message om... I need to create a macro in Excel which reads from an ini file. Word uses the system.privateprofilestring but I can't find anything like this in Excel. Any suggestions greatly appreciated! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading from ini file
Thanks Colo - I'll give that a try as well and see how it goes!
Colo wrote in message ... Tammy, :) Because an ini file is just a text file, it can be read with Open statment. Code: -------------------- Sub test() Dim fn As Long Dim tmp As String fn = FreeFile 'Change here to the file path Open "c:\test.ini" For Input As fn Do While Not EOF(fn) Line Input #fn, tmp Debug.Print tmp Loop Close fn End Sub -------------------- --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reading from a text file | Excel Discussion (Misc queries) | |||
reading from another file and pasting to current file, "combobox" | New Users to Excel | |||
Help reading in a text file | Excel Programming | |||
Reading .csv file into array | Excel Programming | |||
Reading from file | Excel Programming |