clear an Excel sheet

 

Hi all, is there a way to clear an Excel sheet?

I'm developing my on Excel sheet to monitor my positions.

I'm searching between the File functions but I don't find it.

Thank you!

 

I'm working on this code to write on a .csv file, but the problem is that I want to leave the file open instead of open, write and close it.

Have you got a suggestion?

Thank you!


int handle_1=FileOpen("Monitor.csv", FILE_CSV|FILE_READ|FILE_WRITE, ';');
       
       FileSeek(handle_1, 0, SEEK_END);
       //---- add data to the end of file 
       FileWrite(handle_1,OrderTicket(),OrderSymbol(),OrderType(),OrderMagicNumber(),Entry_Bar,Bars,Size_1,Size_2,Size_3,Size_4,Take_1,Take_2,Take_3);
       FileClose(handle_1);
       
       handle_1=0;
 
Alberto Tortella: t the problem is that I want to leave the file open instead of open, write and close it. Have you got a suggestion?

You haven't stated a problem. So do it. Open and seek in OnInit, write in OnTick when something changes, close on OnDeinit.

You won't be able to read the file elsewhere unless you also add FILE_SHARE_READ.