示例代碼隱藏通過C#的excel的標籤欄(在底部)...
object misValue = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Excel.Application appExcel = new
Microsoft.Office.Interop.Excel.Application();
appExcel.Visible = false;
Microsoft.Office.Interop.Excel.Workbook workbook = appExcel.Workbooks.Add(misValue);
Microsoft.Office.Interop.Excel.Worksheet worksheet = (Microsoft.Office.Interop.Excel.Worksheet)workbook.Sheets[1];
workbook.SaveAs(Environment.CurrentDirectory + @"\a.xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
appExcel.ActiveWindow.DisplayWorkbookTabs = FALSE;
appExcel.Workbooks.Close();
appExcel.Quit();
Marshal.ReleaseComObject(worksheet);
Marshal.ReleaseComObject(workbook);
您可以保護工作簿結構。然後按鈕不會做任何事情。 – teylyn
我知道這個teylyn,但我正在尋找一種方法來完全隱藏它,因爲我的老闆專注於此。 –
是否隱藏工作簿中的所有選項卡對您來說都是矯枉過正? – pnuts