Excel(xls) to MQL4

 

Hi forum i was roaming in topics but i coudnt find the exact discus even i was see several similar topic

my question is how to or is there a way to do assign a data in excel cells like "hellowrold" or digits "123124" in G5 cell to an int, bool or double doesnt matter.

if you redirect me to neccesery topic or send an example snippetto here.

thanks best regards..

 
IMO, data on a spread-sheet can be expressed as a 2-dimensional Array. Therefore G5, could be referenced as Array[7][5], Column_7, Row_5. If you don't already have a strong understanding of Arrays then I'll recommend the Book. Ps> Don't forget to -1 when working with Arrays. 8P
 
thanks for answerd i have some array knowledge but i need a sample complate spinnet like
int start()
{
int handle;
string str;
handle = FileOpen("any.xls", FILE_CSV|FILE_READ,';');
str=FileReadString(handle);
for example this one is not work but may be you show how to do thanks
 
In this case a sample wouldn't help you understand why. For example can you tell me why the sample above does-not work? I believe you have to understand the codes you use. And that only comes with the experience of trying, finding your mistakes, trying again......and again. Getting codes which already works does-not help learning.
 

it doesnt work because i think FILE_CVS FILE_READ, cant read the .xls which is placed in file folder and cant define it to string or int.

i have an indicator for show the data in str as example "Hello" on the chart for testing variables straightly defined or not the variable

mean time

when i do with any.txt its contains "hello world" text and it works i just cant do it with xls

thanks best regards

 
if you need complate code i can send
 
fxdj:

when i do with any.txt its contains "hello world" text and it works i just cant do it with xls

thanks best regards

xls is not txt or csv, it's a proprietary Microsoft file format.
 

so any solutuon or advise ? to do this or u said there is no way to do

thanks

 
or can we do this from a cvs file that we can use as xls with same method ?
 
fxdj:
or can we do this from a cvs file that we can use as xls with same method ?
You can read a CSV file, yes.
 

i wonder even if its works is there way to read data from xls file

thanks

Reason: