Sunday, March 23, 2008

Launching Excel to view Files from VB.NET

Launching Excel from VB.NET to view a file (.xls, .csv, .etc) has a seemingly simple solution:


However, this simple solution has a problem. After Excel is running, it does not respond to this type of command anymore. Excel has to be closed (killed) before you can successfully call Start again with any file that is associated with Excel.

I see several different approaches to this problem:

There is also a totally different approach using Excel's automation to open the file:

No comments: