My VBA code runs a batch file which gives call to an executable file (C# application). This exe is used to export data from a datasource and writes it in a file created in a subfolder in current directory. When I run this code, it launches the command prompt and calls the exe, but this exe does not create a file in my subfolder. When I run this exe manually, it does the job successfully.
This is the VBA code which runs the batch file:
Call Shell("C:\Users\Administrator\Desktop\ClientApp\ExportData.exe 0", vbNormalFocus)
And, this is the code from the C# application which creates a file and writes the result to it:
File.WriteAllText(Directory.GetCurrentDirectory() + "\\temp.bat", command + columnKeys);
var process = Process.Start(Directory.GetCurrentDirectory() + "\\temp.bat");
process.WaitForExit();
The batch called by C# code exports data from a datasource, and writes it to a csv file in sub folder.
I am not able to understand where do I need to make the change - whether in VBA code or in C# code - so that the code could write to the file. How do I resolve this?