I have a main method here that is simply trying to open an excel workbook. This same script works on other machines, but I can't get it to work on this machine. It starts a background EXCEL.exe process, but does not open an excel window.
If I end that process in the task manager, and then open excel, it shows the workbook in the mySheet string variable in the document recovery pane. So something opened. I just couldn't see it. What am I missing here?
Using a Console Application in Visual Studio 2017. Excel 2016 64 bit.
using Excel = Microsoft.Office.Interop.Excel;
static void Main(string[] args)
{
try
{
string mySheet = @"C:\\Users\\dwh002\\Documents\\ZIP_COUNTY_032017.xlsx";
var excelApplication = new Excel.Application();
excelApplication.Visible = true;
var workbooks = excelApplication.Workbooks;
var workbook = workbooks.Open(mySheet);
}
catch (Exception)
{
throw;
}
Visible = trueline after theworkbooks.Openline. I frustratingly can't reproduce your problem.