#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    1
    Rep Power
    0

    Writing to Excel-can u help?


    Hey,

    Does anybody know anything about automatically sending data from a C program to Excel for output?
    Automatic population etc??

    I've done some research & come across CSV files (comma spaced value) which could be read in pretty easily I think.

    So, the 2 things are...

    creating CSV files from within the program
    &
    sending them to Excel to open

    Thanks,
    Mike.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    1. create csv: write a text file with the data in in in csv format.
    2. start excel: system("msexcel myfile.csv");
    this is not portable at all though ;)
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    1
    Rep Power
    0
    Thanks man,

    I'll give it a go!

    Cheers,
    Mike.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    1
    Rep Power
    0

    But...


    The system("msexcel myfile.csv"); command did not work.

    Is msexcel a DOS command because I tried to find info on it & it does not exist as far as google is concerned and the "man msexcel" in DOS does not recognise it!

    Any thoughts?
    Hirsch?
    Anyone?

    Mike.
    :(
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    where did you find the "man" command on dos????

    and no, msexcel is not a dos command. i supposed it to be the name of the executable of MS-Excel. but i looked it up and it is only called excel. supply the full path, then it will start.
    ... only on windows though.

    look at C:\Program Files\Microsoft Office\excel.exe ...could depend on your version of office though...

    another way to use would be "ole automation" (remote control) of msexcel. but i cannot tell you how to do that in c.
    if you are interested, be prepared to read 1000s of docs.

IMN logo majestic logo threadwatch logo seochat tools logo