+ Reply to Thread
Results 1 to 6 of 6

Excel to .ini export or creation.

  1. #1
    Registered User
    Join Date
    05-26-2013
    Location
    Pune
    MS-Off Ver
    Excel 2007
    Posts
    3

    Excel to .ini export or creation.

    Hello Excel Users.

    I have a requirement to create an .ini file from the data entered in the excel workbook.
    I'm attaching both .ini & excel files to get an idea about what i'm trying to achieve.

    On click of a button, an .ini file will be generated at C:\data\012345.ini with the information populated in excel file.

    Following should be contained in an .ini file generated through excel file:
    -------------------------------------------------------------------------------------------

    [EWB]
    JobInfoLine1=L1
    JobInfoLine2=L2
    JobInfoLine3=L3
    JobNumber=USB-012345
    OfficeAddress=XYZ.
    Architect=A.
    Drafter=A.
    Engineer=A.
    Contractor=A.
    SysEngineer=E.
    InstSupervisor=I.
    Language=English
    -------------------------------------------------------------------------------------------

    Thank you in advance.

    Best Regards,

    Mo
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Excel to .ini export or creation.

    Hi Mo,

    Question... You attached an ini.xls file. Normally an ini file, as I've always understood them, is just an ascii text file.

    http://en.wikipedia.org/wiki/INI_file

    Also, in your example, shouldn't Drafter = D, Engineer = A, Contractor = C, and SysEngineer = S? To clarify, shouldn't they equal the data that exists in the corresponding Excel rows? Why are these guys all "As?"

    Anyway, this code creates an ascii text file that matches your example, in your c:\data folder. (Note that there is no error checking... it assumes you do HAVE a C:\data folder.)

    Also, as you can see, the code is not in a loop - it's only going to create the one file - and I'm assuming you probably want it to be in a loop to create multiple files. But you only supplied one record and I don't know or where or how the next record might begin.

    You can assign the code to the click of a button.

    Please Login or Register  to view this content.
    Last edited by Ed_Collins; 05-26-2013 at 04:58 PM. Reason: typo

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Excel to .ini export or creation.

    Hello mo.insane,

    Welcome to the Forum!

    I follow you on the creating/updating the init file from the workbook "USB-012345.xls". What I don't understand is the "ini.xls" workbook. Will this workbook be used with or add to the other workbook? Will this be used on systems later than Windows XP?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    05-26-2013
    Location
    Pune
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Excel to .ini export or creation.

    Hello Leith.

    Thank you for the reply.
    I missed to mention that i attached .ini file in excel file for the reason that excelforum didn't allow me attaching .ini file directly.

    Best Regards,

    Mo

  5. #5
    Registered User
    Join Date
    05-26-2013
    Location
    Pune
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Excel to .ini export or creation.

    Hello Ed_Collins.
    You are right about .ini files. I missed to mention that i've attached .ini in excel file for the reason excelforum doesn't allow me attaching .ini files.
    You are also right about Drafter = D, Engineer = A, Contractor = C, and SysEngineer = S?.
    In current situation, i'm fine without looping. The code is working inline with the requirement.
    I'm really happy and thankful.

    Best Regards,

    Mo

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel to .ini export or creation.

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1