Hi All,
I hope your all alright. I need help i would like to open an excel document by simply clicking a button. Any code or advise will be greatly appreciated.
kind regards. marvin
Excel Document
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Aug 16, 2012, 7:21 AM EDT
System.Diagnostics.Process.Start("somefile.xls"); // or .xlsx
Tarun Bhalodi47 reputationPosted Aug 17, 2012, 12:39 AM EDT
if (objemail.ShowDialog(this)== DialogResult.OK)
{
try
{
DiskFileDestinationOptions diskOpts = ExportOptions.CreateDiskFileDestinationOptions();
ExportOptions exportOpts = new ExportOptions();
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
diskOpts.DiskFileName = Application.StartupPath + "\\Report.pdf;
exportOpts.ExportDestinationOptions = diskOpts;
CryRptDoc.Export(exportOpts);
sendmail();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
"like if ans accurate"