TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
David Smith
NA
2k
0
Launch excel file using Process object
Mar 16 2012 4:15 AM
I am getting error trying to launch the specified executable is not a valid application for this os platform , I am trying to launch a Template.XLS file save values in the files then close file. once i close file I the process detects that the file is close and then i go do something, can someone assist me.
using (StatusBusy busy = new StatusBusy("Launching template.xls. Please wait patiently..."))
{
if (File.Exists(fileName))
{
Process process = new Process();
process.EnableRaisingEvents = true;
process.Exited += new EventHandler(process_Exited);
process.StartInfo.UseShellExecute = false;
process.StartInfo.FileName = fileName;
process.WaitForExit();
if (process.ExitCode == 0)
{
MessageBox.Show("template.xlsprocess complete.");
return true;
}
else
{
MessageBox.Show(" template.xls process Failed.");
process.Kill();
return false;
}
}
else
{
MessageBox.Show("File does not exist");
return false;
}
}
}
catch (Exception ex)
{
MessageBox.Show("Error occurred launching SN template. ",ex.Message);
return false;
}
Reply
Answers (
2
)
Why SQL Express services is not running in some systems ?
identity column