生活随笔
收集整理的這篇文章主要介紹了
asp导出EXCEL数字格式及自动适应宽度的问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
| asp導出EXCEL數字格式及自動適應寬度的問題 下面直接進行代碼演示: <% If Response.IsClientConnected Then Response.Flush Else Response.End End If Set xlApplication = Server.CreateObject("Excel.Application") xlApplication.Visible = False xlApplication.Workbooks.Add Set xlWorksheet = xlApplication.Worksheets(1) xlWorksheet.Cells(9).NumberFormatLocal = "@" '處理為數據格式 xlWorksheet.Cells(1,1).Value = "編號" xlWorksheet.Cells(1,2).Value = "筆記本品牌" xlWorksheet.Cells(1,3).Value = "地址" xlWorksheet.Cells(1,4).Value = "班級" xlWorksheet.Cells(1,5).Value = "IP" xlWorksheet.Cells(1,6).Value = "金額" xlWorksheet.Cells(1,7).Value = "email" xlWorksheet.Cells(1,8).Value = "QQ" xlWorksheet.Cells(1,9).Value = "3503221985080111111" xlWorksheet.Cells.EntireColumn.AutoFit '自動調整列寬 'xlWorksheet.ActiveSheet.Columns[1].ColumnsWidth=50 filename="NBB"&year(now())&month(now())&day(now()) xlWorksheet.SaveAs Server.MapPath(filename & ".xls") xlApplication.Quit Set xlWorksheet = Nothing Set xlApplication = Nothing response.write("生成成功") %> |
?
總結
以上是生活随笔為你收集整理的asp导出EXCEL数字格式及自动适应宽度的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。