-5

I would like to know the correct code, that I should write, in the Expert Advisor, MetaTrader4 Terminal, so as to import a value, from an Excel book, with a name xfox, Sheet casa9, the value that is in a cell A3.

user3666197
  • 1
  • 6
  • 43
  • 77
  • 2
    Hi, welcome to Stack Overflow! We're here to help with code debugging, not writing your code. Please read [What topics can I ask about here?](https://stackoverflow.com/help/on-topic) and [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – jmoon Aug 10 '17 at 17:51

2 Answers2

0

As-Is state:

There is no direct way, how a MetaTrader4 Terminal MQL4 language code-execution unit would read a cell from Excel xfox.xls file.

To-Be state:

Nevertheless, there are ways how to integrate such functionality, by using an externally implemented DLL-function or by using a distributed-computing approach and ask for such a value an externally operated ( distributed-)-agent, that can { directly- | indirectly-}-interact with xfox.xls file.

So the task is doable in several ways.

user3666197
  • 1
  • 6
  • 43
  • 77
0

It depends on your excel version.

if it is MS 2003 - you can download the pachage here, if you have 2007 and newer - you can have a paid version of XLSgate or some other products, XLS has a free package also but it is limited so probably you will have to install 2003 if that works for you.

the free version has all necessary functions, all you need is to

#import
   int ExcelPutString(int,int,int,string);
   int ExcelPutValue(int,int,int,double);
   double ExcelGetValue(int,int,int);
   string ExcelGetString(int,int,int);
#import

about specific sheet - do not remember, seems need to check each sheet name and to know their names and order and input that manually

Daniel Kniaz
  • 4,338
  • 2
  • 11
  • 18