Reputation: 105
this is my variables and my input and result excel file are in different workbooks and I want to show the output workbook only. I want to show Targetworkboo1 in output but with this code, sourceworkbook and Targetworkbook1 will be shown in output. how should I do it?
Excel.Application xlApp = new Excel.Application();
Excel.Workbook SourceWorkbook;
xlApp.Visible = true;
Excel.Workbook TargetWorkbook1;
Excel.Worksheet SourceWorksheet;
Excel.Worksheet TargetWorksheet1;
SourceWorksheet = SourceWorkbook.Worksheets[1];
TargetWorkbook1 = xlApp.Workbooks.Add();
TargetWorksheet1 = TargetWorkbook1.Worksheets[1];
Upvotes: 1
Views: 5934
Reputation: 91
Hide any sheets in excel workbook using this code:
SourceWorksheet.Visible=Excel.XlSheetVisibility.xlSheetHidden;
Upvotes: 4
Reputation: 26989
Hide the window of the workbook:
SourceWorkbook.Windows[1].Visible = false;
Upvotes: 1