Determine your WorkingDirectory
and then use a relative path from there.
Usually the WorkingDirectory
is where your .exe resides, but it depends on how you started your process. Then you can use a relative path like
if (Sport == "Athletics")
{
excel_init("IO/ScoretableMenAthletics.xlsx");
}
I don't know what happens inside your excel_init
, but consider MSDN, ProcessStartInfo.WorkingDirectory Property
:
When the UseShellExecute property is false, gets or sets the working directory for the process to be started. When UseShellExecute is true, gets or sets the directory that contains the process to be started.