Results 1 to 5 of 5

Thread: Update Config file with data from excel

  1. #1
    Seeker tim's Avatar
    Join Date
    Jul 2013
    Excel Version

    Update Config file with data from excel

    Register for a FREE account, and/
    or Log in to avoid these ads!

    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---------------------------------------
    Comment = Painter, Phone 0488/869416, Male, INSS 710356 011 58

    ----------------------------------------Config File: elogd.cfg -----------------------------------
    port = 8080
    SMTP host =
    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

  2. #2
    Acolyte patel's Avatar
    Join Date
    Feb 2014
    attach please a sample excel file and desired output

  3. #3

  4. #4
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Nanaimo, BC, Canada
    Blog Entries
    Excel Version
    Excel Office 365 Insider
    Tim, please have a read of this article:
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: -||- Blog: -||- Forums:
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  5. #5
    Seeker tim's Avatar
    Join Date
    Jul 2013
    Excel Version


    Quote Originally Posted by Ken Puls View Post
    Tim, please have a read of this article:
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts