The following code snippet runs nicely 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 + "\"");
Problem is, on Windows XP the filename contains spaces ("c:\documents and settings..."), so on XP Excel just shows the error "can't open c:\documents.xls".
On Windows Vista and 7 it even works when I set the path/filename to something containing spaces.
Is there a way to change the parameters so it will open on windows XP, too, or will I have to change the temp directory on all my clients computers?