The following code snippet works fine on Windows Vista or Windows 7, but not on XP:
String filename = System.IO.Path.ChangeExtension(System.IO.Path.GetTempFileName(), ".html");
[...write file...]
System.Diagnostics.Process.Start("excel.exe", "\"" + filename + "\"");
The problem in Windows XP filenamecontains spaces ("c: \ documents and settings ..."), so XP Excel simply shows the error "cannot open c: \ documents.xls".
On Windows Vista and 7, it even works when I set the path / file name to something containing spaces.
Is there a way to change the settings so that it also opens in Windows XP, or will I need to change the temp directory on all the computers of my clients?
source
share