0

I have an automated test which produces a csv with two columns of data. I have an excel file which I use to gather the results of all the runs in a worksheet.

I want to fully automate the process of updating the Excel file after each test run.

This is probably what I want to do:

1. Read the two columns from the CSV file
2. Paste the two columns in a worksheet in the excel file, in the first 
   empty column to the right of the existing block of columns.
3. Save the Excel file

EDIT:

Now i understand that i can do steps 1-3 using a macro. All that is left for me to figure out is how to launch the macro.

2

2 Answers 2

1

You can read the csv and write to the Excel sheet with a single data provider, the OleDb provider. Here is an article on how to write to Excel, and here is one on how to read csv.

Sign up to request clarification or add additional context in comments.

Comments

0

Once you write the macro, it should be in the macro list in Excel for that Excel document. You can bind the macro to a keystroke (like Alt-i, Alt-whatever) so that it runs when your press that key combination.

I've done this on a couple of similar projects where I need to import CSV files from other sources and put the data into an Excel sheet (or sheets)

1 Comment

But i still want the macro to be invoked automatically, without me having to do the keystroke.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.