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]
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]