Write from mql4 into an Excel file

 
HI. Sorry for the perhaps trivial question, but what is the easiest way to write from mql4 into an existing Excel file?
 
Search for csv.
 

You don't. Excel is a propriety binary format (values, forumulas, formatting, etc.). Don't try.

Write a CSV file that Excel can read in.

 
Your topic has been moved to the section: MQL4 and MetaTrader 4
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
snatoli:
HI. Sorry for the perhaps trivial question, but what is the easiest way to write from mql4 into an existing Excel file?

Not trivial at all. But it depends on what you're trying to achieve.

You may need to use Excel VBA from within the spreadsheet to read in the new values from a .csv file populated from a MQL EA.

Or just import the csv file.

Again, it depends on what you're doing.

 
snatoli:
HI. Sorry for the perhaps trivial question, but what is the easiest way to write from mql4 into an existing Excel file?
This depends on the format of the excel file. If you are aiming at mire recent excel versions, then you can refer to the open standard of the file format (.xlsx). It is defined as an ISO standard, and the Microsoft specific extensions are openly defined, see link:


What you need to do is, you need to write code that is able to read, interpret and write this format. And your code will require functions for adding, editing and removing elements from that format.

It is for sure not a trivial job, but it is possible to do, as it is an open standard.