Update Config file with data from excel

tim

New member
Joined
Jul 24, 2013
Messages
18
Reaction score
0
Points
0
Excel Version(s)
2016
Hello there,

I can't seem to find a good example to search a config file and update this file from within an excel file.
Can VBA read and write from and to the same open file?
The excel file has a line for each personnel member. I want to update the config file for a Electronic Logbook I
keep for each of our workers.
So I need to look for a certain string in the config file after which the new member can be created.

Important: The new member can only be added after the line that starts with [Info].
The new member has always the same syntax with data from the excel file (see below).
The excel file has following data 1 per line
Name, Team, Phone Number, Male, INSS number
-------------------------------------------New Member---------------------------------------
[Mohamed]
Comment = Painter, Phone 0488/869416, Male, INSS 710356 011 58

----------------------------------------Config File: elogd.cfg -----------------------------------
[global]
port = 8080
SMTP host = relay.xxyyyzzz.com
Logbook dir = c:\DATA\Elog\logbooks
Type Record date = date
Preset Record date = $date
Date format = %d %m %Y
List Display = ID, Record date, Subject, Category
Start page = ?rsort=Record date
Default encoding = 0
Options Category = Leave, sickness, Salary, Question, Late, Evaluation
Extendable Options = Category
Reverse sort = 1
Quick filter = Date, Subject


Preset Author= Tim
[Info]
 

patel

New member
Joined
Feb 20, 2014
Messages
60
Reaction score
0
Points
0
Location
Italy
Excel Version(s)
2010
attach please a sample excel file and desired output
 

tim

New member
Joined
Jul 24, 2013
Messages
18
Reaction score
0
Points
0
Excel Version(s)
2016
Tim, please have a read of this article: http://www.excelguru.ca/content.php?184

OK sorry was not aware of this. Thought to post my problem in 2 languages to have a better of a solution.
I will be more considerate in the future.

Thankx anyway for the answers ... I got a nearly finished solution now, still needs some work but that's ok.
 
Top