Results 1 to 5 of 5

Thread: Update Config file with data from excel

  1. #1

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

  2. #2
    Acolyte patel's Avatar
    Join Date
    Feb 2014
    Location
    Italy
    Posts
    59
    Articles
    0
    attach please a sample excel file and desired output

  3. #3

  4. #4
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,225
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Tim, please have a read of this article: http://www.excelguru.ca/content.php?184
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

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

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/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

    Post

    Quote Originally Posted by Ken Puls View Post
    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.

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
  •