how to open a blank excel file with headers in asp.net usingHPHardik Patel13yAsked Oct 12, 2013, 8:32 AM2.4kLearn iOS Programmingi want to generate excel file with only header in asp.net..likeName Gender Standard
RZRing Zhong13y agoPosted Oct 22, 2013, 11:19 PMCreate an excel file with the template of your choiceplace the file inside a directory of your website.Create link on a page to the filethe link below may also help you. http://office.microsoft.com/en-in/excel-help/customizing-excel-defaults-with-templates-HA001054815.aspx
Sunny Sharma13y agoPosted Oct 12, 2013, 11:53 AMHi Hardik,Use this code:-------------------------------------------------------------------Application NewExcelApp = new ApplicationClass(){ Visible = false }; _Workbook NewWorkBook = NewExcelApp.Workbooks.Add(Missing.Value); _Worksheet NewWorkSheet = (_Worksheet)NewWorkBook.ActiveSheet; NewWorkSheet.Cells[1, 1] = "Name"; NewWorkSheet.Cells[1, 2] = "Gender"; NewWorkSheet.Cells[1, 3] = "Standard"; NewWorkSheet.SaveAs(fname + ".xls", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); NewWorkBook.Close(Missing.Value, Missing.Value, Missing.Value); NewWorkSheet = null; NewWorkBook = null; NewExcelApp.Quit(); ----------------------------------------------------------------------------------------HTH :)
Ring ZhongPosted Oct 22, 2013, 11:19 PM
the link below may also help you.
http://office.microsoft.com/en-in/excel-help/customizing-excel-defaults-with-templates-HA001054815.aspxSunny SharmaPosted Oct 12, 2013, 11:53 AM
Use this code:
-------------------------------------------------------------------
----------------------------------------------------------------------------------------
HTH :)