ERR_CANNOT_OPEN_FILE Error 4103

 

Hi,

what do I have to change, if I get the ERR_CANNOT_OPEN_FILE Error, when I want to open a csv-File in the

C:\Program Files\MetaTrader - Alpari_Demo\experts\files - folder??

Thank you!

 
Where is your code? Paste in here with the SRC button above.
 

Here is my code:

handle=FileOpen("Schließungszeiten.csv",FILE_CSV|FILE_READ,';');

if(handle<0)
{ if(GetLastError()==4103)
Alert("Das File kann nicht geöffnet werden ","Schließungszeiten.csv");
else
Alert("Fehler beim Öffnen der Datei ","Schließungszeiten.csv");
return;
}

 
handle=FileOpen("Schließungszeiten.csv",FILE_CSV|FILE_READ,';');
It's not gonna read the file unless the file exists. You'll want to combine with FILE_WRITE | FILE_READ so that it'll create the file if it does not exist.
 

I have already created the file. It does exist, but I can't open it. Why??

 
Are you trying to open the file in the back_tester?
 
  1. If you're using the tester and not live the files are in the tester path not experts.

  2. sunshineh:

    handle=FileOpen("Schließungszeiten.csv",FILE_CSV|FILE_READ,';');

    There's nothing in the documentation about extended character sets IIRC. Try renaming the file to SchlieBungszeiten.csv and modify the code.