A free component to create Excel files on the fly
Techniques
This section makes it possible to gather a whole of techniques or scripts which have the originality to manage to solve a difficulty with the least effort or which are particularly effective...The grayed entries relate to the future headings which will supplement soon this toolbox.
Techniques / Composants Excel : DypsXLS
- A free component to create Excel files on the fly :
This short example will help you to learn how to create a simple Excel file on the fly with DypsXLS.
<% set wbook = createObject("DypsXLS.XLSApplication") 'Create a Workbook Object and set a password 'to make it read-only 'Set wbook = CreateExcelWorkbook() wbook.password = "myPassword" ' The default font is Tahoma,10 wbook.SetDefaultFont "Tahoma", 9 ' Create Worksheets wbook.AddSheet("FirstSheet") ' SecondSheet is hidden wbook.AddSheet("SecondSheet",False) ' The sheet name could be ommit in ' order to have the default one wbook.AddSheet ' Add Sheet and return a XLSWorkSheet object Set wsheet = wbook.AddSheet("MySheet") 'Get a reference to the second sheet Set wsheet = wbook.GetSheet(2) 'and similar : Set wsheet = wbook.GetSheet("SecondSheet") ' Set the scale factor for the sheet (in percent) wsheet.ScaleFactor = 95 'Set the active sheet when opened wbook.SetActiveSheet "MySheet" '' Or wbook.SetActiveSheet 3 'adding cells to a worksheet Set cell = wsheet.AddCell(1, 1,"MyValue") 'cell A1 'Use GetCell to retrieve an already existing cell Set cell = wsheet.GetCell(1, 1) 'Cell A1 cell.value = "4" 'If you have write permission : wbook.Save server.mapPath("myExcelWork.xls") %>
<See object reference for DypsXLS>
Page suivante
You could now ask for support by using the forum.