Home » questions » Excel conversion from CSV to XLS?

Excel conversion from CSV to XLS?

2006-07-30 20:06:17, Category: Programming & Design
I am working on developing a user interface for a machine that collects environmental monitoring data (at a pharmaceutical company) from a serial device and dumps it in to a CSV file. I have been asked that after the dump, a mechanism be put in place that would hide certain columns automatically and prevent others from being edited. I basically need to be able to take the pre-existing csv file and convert it to xls with the specified restrictions. Does anyone have any ideas?

Answers

  1. crazyhumans

    On 2006-07-30 20:11:37


    It can be done. You will have to write a macro or a program in VB for excel to do that. You can prevent columns from being edited by protecting the cells. Only people with the password can edit the cells.
  2. rb42redsuns

    On 2006-07-30 20:11:34


    Can you do it with a Macro? If your imported data always has the same format, you should be able to record your keystrokes to hide the columns. Not sure how to lock others from being edited. Different files, perhaps?
  3. SquirrelNutz

    On 2006-07-30 21:14:27


    If the original mechanism is written in VB then you can simply use the Excel library for VB and convert the CSV file to an XLS file type and protect it to the extent needed. If the original mechanism isn't written in VB, then you'd likely need to write a separate program to do the file conversion. Another alternative would be to take an Excel file and use Data Import feature to create a link to the CSV file - and simply use the data source to update the content of the new Excel file any time the CSV file is regenerated.
  4. knieveltech

    On 2006-07-30 20:29:27


    Based on what you've said here it seems to me that the optimal solution would be to import the .csv data into a database, then use whatever reporting methodology you prefer to query. If the client has explicitly stated that using a DB is out of the question, or that final output is to be in excel format, you may consider using some excel VBA to massage the data into the required shape, handle what is and isn't viewable, etc.
  5. EG345

    On 2006-07-30 20:10:39


    Just open it in Excel and save as .xls.