Please EDIT your post and use the CODE button when you insert code.
-
Use the code button
- Terry McCall: change the file destination folder, to say string mySpreadsheet= "G:\\My Drive\\Account.csv"
File Write Problem (Error: 5002) - Expert Advisors and Automated Trading - MQL5 programming forum #1-2 (2020)
and FolderDelete using TERMINAL_DATA_PATH - General - MQL5 programming forum (2017)
In MQL, file access is "sandboxed". You can't directly access files on any path (.e.g. "G:\\My Drive\\AccountHistory.csv" will fail).
You can only access files in the "sandbox". Please read the documentation ... https://docs.mql4.com/files/fileopen
Note
For security reasons, work with files is strictly controlled in the MQL4 language. Files with which file operations are conducted using MQL4 means, cannot be outside the file sandbox.
The file is opened in the folder of the client terminal in the subfolder MQL4\files (or Tester\Files in case of testing). If FILE_COMMON is specified among flags, the file is opened in a shared folder for all MetaTrader 4 client terminals.
Please also read the links that William has provide in the previous post.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have writing a script and it work fine if I have the File path set as... string mySpreadsheet= "Account.csv" it will save the file in the files folder in MQL$>Files like I would expect Fig1 but if I change the file destination folder, to say string mySpreadsheet= "G:\\My Drive\\Account.csv" the script runs ok and I get the end message that the file has been saved but when I look in the folder it hasn't appeared, I have tried various file locations but to no avail.