Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel not visible in c#
Hi,
I am running excel 2000. with version 9.0 type library. I cannot see the excel application, althought it appears on the taskbar. I have tried the following code: Excel.Application xlApp; Excel.Workbook ExcelWorkbook; Excel.Worksheet ExcelWorkSheet; xlApp = new Excel.ApplicationClass(); ExcelWorkbook = (Excel.Workbook)(xlApp.Workbooks.Add(Type.Missing) ); ExcelWorkSheet = (Excel.Worksheet)ExcelWorkbook.Sheets["Sheet1"]; ExcelWorkSheet.Name = "My Sheet"; ExcelWorkSheet.Activate(); xlApp.Visible = true; xlApp.UserControl = true; ExcelWorkSheet.Cells[1, 1] = "test sheet"; xlApp.Quit(); Marshal.ReleaseComObject(ExcelWorkSheet); Marshal.ReleaseComObject(ExcelWorkbook); Marshal.ReleaseComObject(xlApp); but it does not make the excel visible. any help appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel not visible in c#
xlApp.Visible = True
This should enable you to see the app. Check Task Manager to see if the app is running. If it doesn't appear in the Applications tab,check the processes tab. If it does appear in Applications, it may be that it's coordinates got stuffed and it's off screen somewhere. -----Original Message----- Hi, I am running excel 2000. with version 9.0 type library. I cannot see the excel application, althought it appears on the taskbar. I have tried the following code: Excel.Application xlApp; Excel.Workbook ExcelWorkbook; Excel.Worksheet ExcelWorkSheet; xlApp = new Excel.ApplicationClass(); ExcelWorkbook = (Excel.Workbook)(xlApp.Workbooks.Add (Type.Missing)); ExcelWorkSheet = (Excel.Worksheet)ExcelWorkbook.Sheets ["Sheet1"]; ExcelWorkSheet.Name = "My Sheet"; ExcelWorkSheet.Activate(); xlApp.Visible = true; xlApp.UserControl = true; ExcelWorkSheet.Cells[1, 1] = "test sheet"; xlApp.Quit(); Marshal.ReleaseComObject(ExcelWorkSheet); Marshal.ReleaseComObject(ExcelWorkbook); Marshal.ReleaseComObject(xlApp); but it does not make the excel visible. any help appreciated. . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel not visible in c#
Thanks Patrick.
I have tried that. The process is running (checked task manager) but I cannot see the excel. "Patrick Molloy" wrote in message ... xlApp.Visible = True This should enable you to see the app. Check Task Manager to see if the app is running. If it doesn't appear in the Applications tab,check the processes tab. If it does appear in Applications, it may be that it's coordinates got stuffed and it's off screen somewhere. -----Original Message----- Hi, I am running excel 2000. with version 9.0 type library. I cannot see the excel application, althought it appears on the taskbar. I have tried the following code: Excel.Application xlApp; Excel.Workbook ExcelWorkbook; Excel.Worksheet ExcelWorkSheet; xlApp = new Excel.ApplicationClass(); ExcelWorkbook = (Excel.Workbook)(xlApp.Workbooks.Add (Type.Missing)); ExcelWorkSheet = (Excel.Worksheet)ExcelWorkbook.Sheets ["Sheet1"]; ExcelWorkSheet.Name = "My Sheet"; ExcelWorkSheet.Activate(); xlApp.Visible = true; xlApp.UserControl = true; ExcelWorkSheet.Cells[1, 1] = "test sheet"; xlApp.Quit(); Marshal.ReleaseComObject(ExcelWorkSheet); Marshal.ReleaseComObject(ExcelWorkbook); Marshal.ReleaseComObject(xlApp); but it does not make the excel visible. any help appreciated. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel: No visible table | Excel Discussion (Misc queries) | |||
Some gridlines are not visible in Excel | Excel Worksheet Functions | |||
Excel sheet not visible | Excel Discussion (Misc queries) | |||
Comma is not visible in Excel | Excel Discussion (Misc queries) | |||
Autoshapes not visible on spreadsheet but visible in print preview | Excel Discussion (Misc queries) |